Answer the question
In order to leave comments, you need to log in
How to hide them after pressing the buttons in a message from Telegram-Bot?
There is a Telegram-Bot, I use the library: https://github.com/irazasyed/telegram-bot-sdk
The
bot sends a message to the user with two buttons.
The user presses one of the buttons - the request is sent and the buttons are hidden from this message - is this possible?
Answer the question
In order to leave comments, you need to log in
I figured it out and here is a small example (clipping):
$telegram = new Telegram\Bot\Api('XXXXXXXXXXXXXXXXXXXX');
$update = $this->telegram->getWebhookUpdates();
$update = json_decode($this->update, true);
$keyboard = Keyboard::make()->inline()->row(Keyboard::inlineButton(['text' => 'One more?','callback_data' => '/random']));
$telegram->editMessageText([
'chat_id' => $update['callback_query']['message']['chat']['id'],
'message_id' => $update['callback_query']['message']['message_id'],
'text' => 'Ответочка',
'reply_markup' => $keyboard,
'parse_mode' => 'markdown',
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question