ConversationMenu
ref / conversations / ConversationMenu
A conversational menu is a set of interactive buttons that is displayed beneath a message. It uses an inline keyboard for that, so in a sense, a conversational menu is just an inline keyboard spiced up with interactivity (such as navigation between multiple pages).
ts
// Create a simple conversational menu
const menu = conversation.menu()
.text('A', ctx => ctx.reply('You pressed A!')).row()
.text('B', ctx => ctx.reply('You pressed B!'))
// Send the conversational menu
await ctx.reply('Check out this menu:', { reply_markup: menu })
Check out the official documentation to see how you can create menus that span several pages, how to navigate between them, and more.
Extends
Implements
Type Parameters
C
ts
C extends Context
Constructors
ts
ConversationMenu(id: string, options: Partial<ConversationMenuOptions<C>>);
Properties
[opts]
ts
[opts]: ConversationMenuOptions<C>;
inline_keyboard
ts
readonly inline_keyboard;
id
ts
readonly id: string;