I have a problem with inline bots with Telegram API…
I have the code:
$json = file_get_contents("php://input");
$dados = json_decode($json,true);
$id_query = $dados['inline_query']['id'];
$resultados_inline[] = [
'type' => 'article',
'id' => "1",
'title' => "Test",
'message_text' => "test",
];
$post[] = [
'inline_query_id' => $id_query,
'results' => serialize($resultados_inline),
];
$context_options = array(
'http' => array(
'method' => 'POST',
'header'=> "Content-type: application/x-www-form-urlencodedrn"
. "Content-Length: " . strlen($post) . "rn",
'content' => $post
)
);
file_get_contents("https://api.telegram.org/bot" . $api_telegram . "/answerInlineQuery",NULL,$context);
But i receive:
{“ok”:false,”error_code”:400,”description”:”BadRequest:QUERY_ID_INVALID”}
Can somebody help me?
Thanks
2
Answers
This error is possible if inline query timeouted. If you send fresh request everything will be Ok.
I searched for this problem and i got this answer from Bot support:
i just stop to use debugger mode and all works, this is a API restriction to UX.