Ped*_*nio 3 api bots inline telegram telegram-bot
我对带有 Telegram API 的内联机器人有问题...
我有代码:
$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-urlencoded\r\n"
. "Content-Length: " . strlen($post) . "\r\n",
'content' => $post
)
);
file_get_contents("https://api.telegram.org/bot" . $api_telegram . "/answerInlineQuery",NULL,$context);
Run Code Online (Sandbox Code Playgroud)
但我收到:
{"ok":false,"error_code":400,"description":"BadRequest:QUERY_ID_INVALID"}
有人可以帮助我吗?
谢谢
我搜索了这个问题,我从 Bot 支持那里得到了这个答案:
“内联查询需要快速回答,如果回答延迟,您可能会收到该错误并且答案无效。我建议您更快地回答他们以使他们工作。”
我只是停止使用调试器模式并且一切正常,这是对 UX 的 API 限制。