Answer the question
In order to leave comments, you need to log in
How to understand that there was a response to a button in Telegram?
Hello everyone, using irazasyed/telegram-bot-sdk
Wrote a web hook handler, and a small chain of keyboards.
The question is how to understand after pressing the button and sending a text response that this text message is the answer to the previously pressed button.
https://i.imgur.com/B4BJwZ7.png
Answer the question
In order to leave comments, you need to log in
https://github.com/aethletic/botify#-states
$bot->setState('how_much_is');
$bot->state('how_much_is')
->hear('{default}', function () use ($bot) {
$count = (int) $bot->message;
$bot->say("Ты выполнил {$count} раз?");
}
)
// or
if ($bot->state_name == 'how_much_is' && $bot->message !== 'СТОП СЛОВО ДЛЯ ВЫХОДА ИЗ СТЕЙТА') {
// code...
} else {
$bot->clearState();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question