Eleirbag89 / TelegramBotPHP

A very simple PHP Telegram Bot API for sending messages.
http://eleirbag89.github.io/TelegramBotPHP
MIT License
807 stars 341 forks source link

how to use buildInlineKeyBoard in InlineQueryResultArticle? #158

Closed moeinmoradigithub closed 3 years ago

moeinmoradigithub commented 6 years ago

hi i have a problem with InlineQueryResultArticle method: InlineQueryResultArticle have an optional field: reply_markup i want to use reply_markup for create a button under my message when user clicked one of the results in inline mode.

in the other words my messages must be exactly like imdb bot (https://telegram.me/imdb)

i wrote this code but it is not working:

$option = array( array($telegram->buildInlineKeyboardButton("button","www.google.com")) ) ;$keyb = $telegram->buildInlineKeyBoard($option); $results=array( array( 'type' => "article", 'id' => "1", 'title' => "title 1", 'message_text'=>"message 1", 'reply_markup'=> $keyb, 'description'=> "description of the title" ) ); $content = array('inline_query_id'=>$inline_query_id,'results' => json_encode($results)); $telegram->answerInlineQuery($content); wwww

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.