Answer the question
In order to leave comments, you need to log in
Telegram bot api how to use answercallbackquery to display alert?
There was a misunderstanding how to call answercallbackquery https://core.telegram.org/bots/api#answercallbackquery ?
Endpoint:
https://api.telegram.org/bot/answerCallbackQuery
making a request:
{
"callback_query_id":"123123123123123123",
"text":"alert",
"url":"http://ya.ru"
}
{
"ok": false,
"error_code": 400,
"description": "Bad Request: QUERY_ID_INVALID"
}
Answer the question
In order to leave comments, you need to log in
In the callback_query_id field, you need to write the id that you received when requesting a callback
// Ответ на нажатие кнопок
function send_answerCallbackQuery($token, $callback_query_id, $text, $show_alert){
file_get_contents("https://api.telegram.org/bot".$token."/answerCallbackQuery?callback_query_id=".$callback_query_id."&text=".$text."&show_alert=".$show_alert);
}
if (isset($data['callback_query'])) {
send_answerCallbackQuery($token, $data['callback_query']['id'], "проверка ", false);
}
Similarly, I want to make an alert message
via GetUpdate, it doesn’t work, the webhook is installed,
I don’t quite understand what needs to be specified in the callback_query_id field
, before I received a response when I clicked the inline button
then I make a request
I get the same error as you. I don't quite understand how to use this feature.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question