如何使用answerInlineQuery Telegram bot发送inlineKeyboard

时间:2019-02-25 14:40:21

标签: telegram-bot php-telegram-bot

我有一个带有irazasyed软件包的电报机器人,并且当用户类型(@botid aboutus)机器人显示如下用户文字时,现在将其设置为“内联模式”: enter image description here

现在我需要在用户单击该项目时,机器人将inlineKeyboard发送给用户,如下所示: enter image description here

1 个答案:

答案 0 :(得分:1)

解决了!

$results= json_encode(  [ 
    [
    'type' => "article",
    'id'=> "1", 


    'title'=> "chek inline keybord ",
    'description'=> "test ",
    'caption'=> "caption" ,
    'input_message_content'=> ['message_text' => "you can share inline keyboard to other chat"],
    'reply_markup'=>['inline_keyboard'=>[
                        [
                            ['text'=>"text1",'url'=>''],
                            ['text'=>"text2",'url'=>''],
                            ['text'=>"shareToOtherChat",'switch_inline_query'=>'chek']
                        ]
                        ]],
    'thumb_url'=> "https://avatars2.githubusercontent.com/u/10547598?v=3&s=88",
    ]
    ] );