T
T
Telegram2017-05-09 19:32:02
Bots
Telegram, 2017-05-09 19:32:02

Is it possible to insert an Inline keyboard in the sendMessage method, and how will it look like?

Request:

api.telegram.org/bot"token"/sendMessage&chat_id="chat_id"&text="txt"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2017-05-09
@Tettel

Yes, you can.

$params['text'] = 'Выберите язык....';
$params['disable_notification'] = TRUE;
$params['parse_mode'] = 'HTML';

$button_en = array('text' => 'English', 'callback_data' => '/lang_english');
$button_ru = array('text' => 'Русский', 'callback_data' => '/lang_russian');
        
$keyboard = array('inline_keyboard' => array(array($button_en, $button_ru)));
$params['reply_markup'] = json_encode($keyboard, TRUE);
// выполняете sendMessage, у меня например вот так:
//$data = $this->tlgrm->send_message($params);

It looks like this:
And documentation to help.

Y
Yaroslav Kornilov, 2017-05-09
@yaroslavkornilov

it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question