Skip to main content
Module

x/grammy_menu/mod.ts>MenuFlavor

Easily create interactive menus with grammY.
Go to Latest
interface MenuFlavor
import { type MenuFlavor } from "https://deno.land/x/grammy_menu@v1.1.2/mod.ts";

Context flavor for context objects in listeners that react to menus. Provides ctx.menu, a control pane for the respective menu.

Properties

optional
match: string

Control panel for the currently active menu. ctx.menu is only available for listeners that are passed as handlers to a 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 alter the context object 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.menu, the new menu will be automatically injected into the payload. Otherwise, a dedicated API call will be performed after your middleware completes.