Callback query doesn't work php telegram?

Callback query doesn't work.
I use https://github.com/TelegramBot/Api.
public function actionMybigbot(){
 $token = '*************************************************';
 $bot = new Client($token);
 $bot->on(function ($update) use ($bot) {
 $message = $update->getMessage();
 $text = $message->getText();
 $chat_id = $update->getMessage()->getChat()->getId();
 $keyboardQuest = [
['text'=>'1-Savol','callback_data'=>'q1'],
['text'=>'2-Savol','callback_data'=>'q2'],
['text'=>'3-Savol','callback_data'=>'q3'],
['text'=>'4-Savol','callback_data'=>'q4'],
['text'=>'5-Savol','callback_data'=>'q5'],
];
 switch ($text){
 case '/start':
 $keyboard = new \TelegramBot\Api\Types\ReplyKeyboardMarkup(array(array("Savollar", "Javoblar")), true,true);
 $bot->sendMessage($chat_id, 'awdawd',null,false,null,$keyboard);
break;
 case 'Savollar':
 $keyboard = new \TelegramBot\Api\Types\Inline\InlineKeyboardMarkup(array($keyboardQuest));
 $bot->sendMessage($chat_id, 'Savollardan birini tanlang!',null,false,null,$keyboard);
break;
}
 },function($message){ return true;});

 $bot->callbackQuery(function ($callbackQuery) use ($bot) {

 $bot->sendMessage($chat_id, 'Savollardan birini tanlang!');

});
$bot->run();
 }
April 19th 20 at 12:18
0 answer

Find more questions by tags TelegramPHP