0
votes

I know this is url for send message in telegram bot api:

https://api.telegram.org/botTOKEN/sendMessage?chat_id=10101010&text="this is for test"

but how i set parametr to url to use ReplymarkupKeyboard i only need by url no by code tnx

1

1 Answers

0
votes

if found answer by own:

for send ReplyKeyboardMarkup by url we should use this way:

https://api.telegram.org/botTOKEN/sendMessage?chat_id=10101010&text="TEST"&reply_markup={"keyboard":[["A","B"]]}

and for find this url (or use code for send message) in php code is:

$replyMarkup = array(
    'keyboard' => array(
        array("A", "B")
    )
);
$encodedMarkup = json_encode($replyMarkup);
$content = array(
    'chat_id' => "10101010",
    'reply_markup' => $encodedMarkup,
    'text' => "Test"
);

$newn = json_encode($content);
$newh = json_decode($newn);
echo http_build_query($newh)