O
O
okovalev2020-06-11 09:47:13
PHP
okovalev, 2020-06-11 09:47:13

How to send keyboard to telegram-bot-sdk (3.2)?

Version 2 documentation: https://telegram-bot-sdk.readme.io/docs/keyboards

$keyboard = [
    ['7', '8', '9'],
    ['4', '5', '6'],
    ['1', '2', '3'],
         ['0']
];

$reply_markup = $telegram->replyKeyboardMarkup([
    'keyboard' => $keyboard, 
    'resize_keyboard' => true, 
    'one_time_keyboard' => true
]);

$response = $telegram->sendMessage([
    'chat_id' => 'CHAT_ID', 
    'text' => 'Hello World', 
    'reply_markup' => $reply_markup
]);

$messageId = $response->getMessageId();


Class 3 version of Keyboard.php on gitHub: https://github.com/irazasyed/telegram-bot-sdk/blob...

How to send a keyboard like the example above in v.3?
I can not understand. Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nokimaro, 2020-06-11
@okovalev

How to set a keyboard from an array?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question