telegram-bot-sdk
telegram-bot-sdk copied to clipboard
How send Inline Keyboard Markup?
In the documentation, I only found how to send ReplyKeyboardMarkup. And InlineKeyboardMarkup is not.
Example

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
@alekssamos what version are you using?
@alekssamos what version are you using?
@yongkylie v2.2.0
Code example on 2.*
$inline_keyboard[] = [
[
'text' =>'title',
'callback_data' => 'some data'
]
];
$reply_markup = Telegram::replyKeyboardMarkup([
'inline_keyboard' => $inline_keyboard,
'resize_keyboard' => true
]);
$response = Telegram::sendMessage([
'text' => 'Message',
'reply_markup' => $reply_markup,
'chat_id' => $chatId
]);
Method [replyKeyboardMarkup] does not exist.
@MrThursby +1
@qwertynik This method was removed (or renamed or moved), but the docs were not updated... To create a keyboard, use the Telegram\Bot\Keyboard class;
Example
class ExampleCommand extends Telegram\Bot\Commands\Command
public function handle()
{
$this->replyWithMessage([
'text' => 'Hello',
'reply_markup' =>
Keyboard::make([
'inline_keyboard' => [
[
[
'text' => 'ok',
'callback_data' => 'data_ok',
],
[
'text' => 'noO',
'callback_data' => 'data_noO',
],
],
],
'resize_keyboard' => true,
])
]);
}