Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/grammy_menu/mod.ts>Menu#register

Interactive menus for grammY.
Go to Latest
method Menu.prototype.register
import { Menu } from "https://deno.land/x/grammy_menu@v1.2.2/mod.ts";

Registers a submenu. This makes it accessible for navigation, and sets its parent menu to this menu.

Optionally, you can specify the identifier of a different parent menu as a second argument. The parent menu is the menu that is targeted when backwards navigation is performed.

Note that once you registered a submenu, it is sufficient to call bot.use(menu) for the parent menu only. You do not need to make all submenus interactive by passing them to bot.use.

Parameters

menus: Menu<C> | Menu<C>[]

The menu to register, or an array of them

optional
parent = [UNSUPPORTED]

An optional parent menu identifier