I wanna send message with inline keyboard.
can u help me to do this?
Do you use with Laravel or without?
Here's an example on how to use it in 3.x:
use Telegram\Bot\Keyboard\Keyboard;
use Telegram;
$keyboard = Keyboard::make()
->inline()
->row(
Keyboard::inlineButton(['text' => 'Test', 'callback_data' => 'data']),
Keyboard::inlineButton(['text' => 'Btn 2', 'callback_data' => 'data_from_btn2'])
);
$response = Telegram::sendMessage([
'chat_id' => 'CHAT_ID',
'text' => 'Hello World',
'reply_markup' => $keyboard
]);
$messageId = $response->getMessageId();
The above should work right now but in develop branch, this has been changed too. So you gotta keep an eye when it's released and upgrade your codes.
@irazasyed Can you please tell me us how to update a message with inline keyboard.
I saw for example in @vote bot, clicking at inline button update whole message and its inline keyboard to brand new one.
How they did it? Delete & resend new message with new inline keybord?
Any help appreciated
I guess, I found the answer. editMessageText is exactly what I'm looking for.
@irazasyed BTW, thanks for your great work. Waiting for version 3.0 and its documentation.
Most helpful comment
Here's an example on how to use it in 3.x:
The above should work right now but in develop branch, this has been changed too. So you gotta keep an eye when it's released and upgrade your codes.