php-telegram-bot

Iinline keyboard. I made a button, but what to do with the callback_data?

本小妞迷上赌 提交于 2019-12-05 06:34:45
问题 Need help with inline keyboard. I made a button, but what to do with the callback? I understand I need to somehow get a callback_data and issue a new message. <?php $access_token = 'xxx'; $api = 'https://api.telegram.org/bot' . $access_token; $output = json_decode(file_get_contents('php://input'), TRUE); $chat_id = $output['message']['chat']['id']; $first_name = $output['message']['chat']['first_name']; $message = $output['message']['text']; $callback_query = $output['callback_query']; $data

Iinline keyboard. I made a button, but what to do with the callback_data?

南楼画角 提交于 2019-12-03 21:28:29
Need help with inline keyboard. I made a button, but what to do with the callback? I understand I need to somehow get a callback_data and issue a new message. <?php $access_token = 'xxx'; $api = 'https://api.telegram.org/bot' . $access_token; $output = json_decode(file_get_contents('php://input'), TRUE); $chat_id = $output['message']['chat']['id']; $first_name = $output['message']['chat']['first_name']; $message = $output['message']['text']; $callback_query = $output['callback_query']; $data = $callback_query['data']; $message_id = ['callback_query']['message']['message_id']; switch($message)