S
S
s71065002019-03-18 11:42:54
Bots
s7106500, 2019-03-18 11:42:54

How to draw inline telegram buttons with a bot via url with parameters?

My bot is controlled by a trading expert from an economic platform. Web query capabilities are severely limited.
Tell me how to collect the url so that there are buttons under the message.
For example, this code option creates buttons for the keyboard:
json parameters are passed to the url.

_https://api. telegram. org/bot782651123:123123123123MjXXYLUsm_B0_15OMZoQ/sendMessage?chat_id=29949698&text=text_here&disable_notification=true&reply_markup={"keyboard":,"one_time_keyboard":false,"resize_keyboard" :false}

Task: send a message with inline buttons with a similar request in the URL
5c8f5817e2d94843137275.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
photozoom, 2019-04-09
@photozoom

$btn1 = ['text' => 'Наш сайт', 'url' => 'https://google.com/'];
$btn2 = ['text' => 'Контакты', 'callback_data' => 'Контакты'];
$btn3 = ['text' => 'О нас', 'callback_data' => 'О нас'];
$inlineKeyboardButtons = ; // Наш сайт будет на первой строке, О нас и Контакты на второй
$inlineKeyboard = ['inline_keyboard' => $inlineKeyboardButtons];
$inlineKeyboard = json_encode($inlineKeyboard);
$url = 'https:// api. telegram. org/bot782651123:123123123123MjXXYLUsm_B0_15OMZoQ/sendMessage?chat_id=29949698&text=text_here&reply_markup='.$inlineKeyboard.

D
Danil K., 2019-06-07
@Danya_Violet

https://api.telegram.org/botTOKEN/sendMessage?chat_id=ID&text=test&reply_markup={"inline_keyboard": }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question