import { MenuRange } from "https://deno.land/x/grammy_menu@v1.2.2/menu.ts";
Adds a button that navigates to a given submenu when pressed. You can pass in the identifier of another menu instance. This way, you can effectively create a network of menus with navigation between them.
It is necessary that you register the targeted submenu by calling
menu.register(submenu)
. Otherwise, no navigation can be performed. Note
that you then don't need to call bot.use(submenu)
anymore, all
registered submenus will automatically become interactive, too.
You can also navigate to this submenu manually by calling
ctx.menu.nav('sub-id')
, where 'sub-id'
is the identifier of the
submenu.
You can call submenu.back()
to add a button that navigates back to the
parent menu, i.e. the menu at which you registered the submenu.
You can get back the submenu
instance by calling parent.at('sub-id')
,
where 'sub-id'
is the identifier you passed to the submenu.