Answer the question
In order to leave comments, you need to log in
Why is the result not displayed in inline mode?
I'm new to php and just started to learn Inline Mode for bot, I have a problem with InlineQueryResultArticle method
Connected via BotFather Inline Mode, bot should display message after typing @botname, but I can't figure out why it's not displayed
function sendRequest($method, $post = '') {
$ch = curl_init('https://api.telegram.org/bot' . BOT_TOKEN . '/' . $method);
if ($post) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
if (strpos($message, "@secret_group_message_bot secret") === 0) {
$post = [
'type' => 'article',
'id' => 1,
'title' => 'aaa',
'description' => 'bbb',
'input_message_content' => [
'message_text' => 'ccc'
],
$inlinekeyboard = [],
'reply_markup' => inline_keyboard($inlinekeyboard)
];
sendRequest('InlineQueryResultArticle', $post);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question