Answer the question
In order to leave comments, you need to log in
Why does telegram bot give multiple response when clicking on inlinekeyboard?
When you click on the inline keyboard button, the bot displays many messages instead of one
How to overcome this?
Here is my code
$bot->on(function($update) use ($bot, $callback_loc, $find_command){
$callback = $update->getCallbackQuery();
$message = $callback->getMessage();
$chatId = $message->getChat()->getId();
$data = $callback->getData();
$bot->sendMessage($chatId, "Вы выбрали $data\n");
}, function($update){
$callback = $update->getCallbackQuery();
if (is_null($callback) || !strlen($callback->getData()))
return false;
return true;
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question