setChatMenuButton()
Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
parameters
| parameter | type | required | description |
|---|---|---|---|
chat_id | number | optional | Unique identifier for the target private chat. If not specified, the bot's default menu button will be changed. |
menu_button | MenuButton | optional | A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault. |
returns
boolean
usage in yaebal
setChatMenuButton is directly typed on Api — call it straight off bot.api.
import type { SetChatMenuButtonParams } from "@yaebal/types";
await bot.api.setChatMenuButton({} satisfies SetChatMenuButtonParams);context shortcut
also available as ctx.setChatMenuButton() on
17
context types — see @yaebal/contexts.
/** Use this method to change the bot's menu button in a private chat, or the default menu button. Returns *True* on success. */
ctx.setChatMenuButton(params: Omit<SetChatMenuButtonParams, "chat_id">)official Bot API docs: https://core.telegram.org/bots/api/#setchatmenubutton