Example json for show inline_keyboard in telegram bot
https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
{
"chat_id": "123456",
"text": "Hi",
"reply_markup": {
"inline_keyboard": [[
{
"text": "A",
"callback_data": "A1"
},
{
"text": "B",
"callback_data": "C1"
}]
]
}
}
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:
And then send a message with the opts:
Hope it helps!
I just had a hard time trying to get it to work on my API and I've found the problem. You need to JSON.stringify() the contents of reply_markup that converts the keyboard object and contents into a string first.
Here's an example.
I wrote this to hopefully make it less confusing.
The output will be:
The circler brackets is the message and the square brackets is the buttons. Both in this example opens a link to Google.