Hello. Learning to do chat bots. Question: Why is the Callback not transmitted when the inline button is clicked? What am I doing wrong?

$chat_id = $result["message"]["chat"]["id"]; $keyboard = Keyboard::make() ->inline() ->row( Keyboard::inlineButton(['text' => 'Show menu', 'callback_data' => 'show_menu']), Keyboard::inlineButton(['text' => 'Request price', 'callback_data' => 'requiest.price']) ); $response = $telegram->sendMessage([ 'chat_id' => $chat_id, 'text' => 'Hello', 'reply_markup' => $keyboard ]); $result = $telegram->getWebhookUpdate(); if ($result->isType('callback_query')) { $query = $result->getCallbackQuery(); $data = $query->getData(); $chid = $query->getFrom()->getId(); $json = json_decode($query->getMessage(), true); $telegram->sendMessage([ 'chat_id' => $chid, 'text' => 'Here is callback', 'reply_markup' => $keyboard ]); } else { $telegram->sendMessage([ 'chat_id' => $chat_id, 'text' => 'Callback is not found here']); } 
  • it seems everything is true outwardly - Anatol
  • @Anatol has changed the telegram's API, now version 2.0 of telegram-bot-sdk does not work quite correctly. - Alexxosipov
  • one
    in this case, it is better to contact the developers of telegram-bot-sdk and start the issue, since the API has not changed, but expanded - Anatol
  • @Anatol already done) - Alexxosipov

0