首页 > 解决方案 > 如何使用 answerInlineQuery Telegram 机器人发送 inlineKeyboard

问题描述

我有一个带有irazasyed包的电报机器人,现在当用户键入(@botid aboutus)机器人为用户显示如下文本时,将其设置为“内联模式”: 在此处输入图像描述

现在我需要当用户单击该项目时,机器人将 inlineKeyboard 发送给用户,如下所示: 在此处输入图像描述

标签: telegram-botphp-telegram-bot

解决方案


解决了!

$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",
    ]
    ] );

推荐阅读