私はphpでテレグラム用のインラインボットを作成しようとしています。私はBotFatherとステップを踏んだ。私は、ボットを作成し、トークンを取得し、setinlineを設定し、プレースホルダメッセージを設定しました。私はwebhookを設定し、それが動作しています。しかし、メッセージにボットをタイプすると何も得られず、メッセージを送信すれば何も起こりません。 Webhookは機能しています。私は通常のメッセージで試してみました。テレグラムインラインボットには何も表示されません
これは私のコードですが、しばらくして私はあきらめてブログから手に入れ、少し編集しました。
$content = file_get_contents("php://input");
$update = json_decode($content, true);
$chatID = $update["message"]["chat"]["id"];
//sendMessage(print_r($update,true), $chatID);
if (isset($update["inline_query"])) {
$inlineQuery = $update["inline_query"];
$queryId = $inlineQuery["id"];
$queryText = $inlineQuery["query"];
if (isset($queryText) && $queryText !== "") {
apiRequestJson("answerInlineQuery", [
"inline_query_id" => $queryId,
"results" => ($queryText),
"cache_time" => 86400,
]);
}
else {
apiRequestJson("answerInlineQuery", [
"inline_query_id" => $queryId,
"results" => [
[
"type" => "article",
"id" => "0",
"title" => "TEST",
"message_text" => "TEST",
],
]
]);
}
}
ボットにはまだ何も表示されません。 私はちょうどステップをスキップしたと思います。
BotのAPIはどのような応答をしますか? – ihoru
@ihoru nothing。私には何も与えません。 –