0

I am making telegram bot with https://github.com/irazasyed/telegram-bot-sdk . Bot sends pictures and videos, however, I want to send 2 buttons like in this image for callbacks.

sd

I have tried keyboards, however, they are not good, as my bot can send 10-15 images simultaneously and the user cannot reply one-by-one. If it is like in the photo, the user will be able to update information any time.

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

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

How can I do that? Thanks in advance!

Javid Abbasov
  • 214
  • 1
  • 4
  • 16
  • An `InlineKeyboard` is used on the image you provided. However, it's not clear what's the problem you encountered. Add some more description and code about your bot's behaviour. – Ivan Vinogradov May 22 '19 at 14:34
  • I use this library for the bot: https://github.com/irazasyed/telegram-bot-sdk . However, I do not know, how to implement this InlineKeyboard to this library for personal use. This library does not have this feature – Javid Abbasov May 22 '19 at 14:38
  • Even through it looks like the library support the keyboards (https://github.com/irazasyed/telegram-bot-sdk/tree/master/src/Keyboard), this library is extremely outdated. – Ruben Bermudez May 23 '19 at 22:58

1 Answers1

0

change $keyboard to:

$keyboard = array('inline_keyboard'=>array(
array(
    array('text'=>'Cancel','callback_data'=>'key=cancel'),
    array('text'=>'Download','callback_data'=>'key=download')
)));

and change keyboard to inline_keyboard

Abdullah Salma
  • 560
  • 7
  • 20