【发布时间】:2016-09-11 01:48:42
【问题描述】:
我对使用 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);
但我收到:
{"ok":false,"error_code":400,"description":"BadRequest:QUERY_ID_INVALID"}
有人可以帮帮我吗?
谢谢
【问题讨论】:
标签: api inline bots telegram telegram-bot