Telegram Inline Bot 不显示任何内容

Telegram Inline Bot shows nothing inline

我正在尝试使用 php 创建用于电报的内联机器人。我已经按照 BotFather 的步骤进行操作。我已经创建了机器人,获取了令牌,设置了在线并设置了占位符消息。我已经设置了 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",
          ],  
        ]
      ]);
     }
    }

机器人仍然没有显示任何内容。 我想我只是跳过了一步。

结果需要在 input_message_content 中包含键 message_text
因此结果可能如下所示:

$results = array(
    array(
        "type" => "article", 
        "id" => "1", 
        "title" => "Title", 
        "description" => "Description", 
        "input_message_content" => array(
            "message_text" => "<code>Message 1</code>", 
            "parse_mode" => "HTML"
        )
    )
);

$postData = array(
    "inline_query_id" => $inlineQuery["id"], 
    "results" => json_encode($results), 
    "cache_time" => 0
);