Telegram bot: example json, inline_keyboard

前端 未结 2 606
野的像风
野的像风 2021-02-10 04:20

Example json for show inline_keyboard in telegram bot

https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating

enter image description here

<
2条回答
  •  情话喂你
    2021-02-10 04:52

    Well, I think I understood what you mean, jeissonp. It seems that you are using Node.js to write Telegram bots, and that's how you provide a user with an inline keyboard:

    Create a keyboard:

    const opts = {
    "reply_markup": {
                "inline_keyboard": [[
                    {
                        "text": "A",
                        "callback_data": "A1"            
                    }, 
                    {
                        "text": "B",
                        "callback_data": "C1"            
                    }]
                ]
            }
    }
    

    And then send a message with the opts:

    bot.sendMessage(chatID, "Message text", opts);
    

    Hope it helps!

提交回复
热议问题