How to create messages with reply buttons #1450
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Hi, there is a lot of examples of Inline Keyboard (That's what they named it 😁). See from Line 61 to Line 125 of the ./docs/examples/keyboard-bot.js They should help you. Those uses For example, bot.command("inline", (ctx) => {
ctx.reply("Hi there!", {
reply_markup: {
inline_keyboard: [
/* Inline buttons. 2 side-by-side */
[ { text: "Button 1", callback_data: "btn-1" }, { text: "Button 2", callback_data: "btn-2" } ],
/* One button */
[ { text: "Next", callback_data: "next" } ],
/* Also, we can have URL buttons. */
[ { text: "Open in browser", url: "telegraf.js.org" } ]
]
}
});
}); But, comparing to the examples, these methods are a bit complicated to write all the time. And that is what telegraf simplified for us to create inline buttons using |
Beta Was this translation helpful? Give feedback.
-
how to make webApp button? |
Beta Was this translation helpful? Give feedback.
Hi, there is a lot of examples of Inline Keyboard (That's what they named it 😁).
See from Line 61 to Line 125 of the ./docs/examples/keyboard-bot.js
They should help you. Those uses
Markup
class. But, you can either do it in the raw method:For example,