【发布时间】:2020-04-05 20:25:04
【问题描述】:
我正在尝试创建一个 Telegram Bot,我在 BotFather 设置中启用了内联,但是当我输入 bot 名称时,它不会显示除搜索之外的任何内容...
$infoUtente = "<b>Ciao! Io sono $username</b>\n\nIl mio chatId è <code>$chatId</code>\nIl mio nome è $name\nIl mio cognome è $cognome";
$risultati=[[
"type" => "article",
"id" => "0",
"title" => "Titolo del Result",
"input_message_content" => array("message_text" => "Testo del Result", "parse_mode" => "HTML"),
"reply_markup" => array("inline_keyboard" => [[array("text" => "CLICCA QUI","url" => "google.com")],[array("text" => "CLICCA QUI","callback_data" => "StampaMessaggio")]]),
"description" => "Descrizione del result",
],
[
"type" => "article",
"id" => "1",
"title" => "Invia le tue informazioni",
"input_message_content" => array("message_text" => "$infoUtente", "parse_mode" => "HTML"),
"reply_markup" => array("inline_keyboard" => [[array("text" => "CLICCA QUI","url" => "google.com")],[array("text" => "CLICCA QUI","callback_data" => "StampaMessaggio")]]),
"description" => "Descrizione del result",
],
];
$risultati = json_encode($risultati,true);
$url = $GLOBALS[website]."/answerInlineQuery?inline_query_id=$queryId&results=$risultati&cache_time=0&switch_pm_text=Vai al Bot&switch_pm_parameter=123";
file_get_contents($url);
exit();
【问题讨论】:
标签: php telegram telegram-bot php-telegram-bot