ConversationMenuFlavor
Context flavor for context objects in listeners that react to conversational menus. Provides ctx
, a control pane for the respective conversational menu.
Properties
match
match?: string;
Narrows down ctx
to string for menu payloads
menu
menu: ConversationMenuControlPanel;
Control panel for the currently active conversational menu. ctx
is only available for listeners that are passed as handlers to a conversational menu, and it allows you to perform simple actions such as navigating the menu, or updating or closing it.
As an example, if you have a text button that changes its label based on ctx
, then you should call
ctx.menu.update()
whenever you mutate some state in such a way that the label should update. The same is true for dynamic ranges that change their layout.
If you edit the message yourself after calling one of the functions on ctx
, the new menu will be automatically injected into the payload. Otherwise, a dedicated API call will be performed after your middleware completes.