setChatMenuButton#
Returns: bool
- class aiogram.methods.set_chat_menu_button.SetChatMenuButton(*, chat_id: Optional[int] = None, menu_button: Optional[Union[MenuButtonDefault, MenuButtonWebApp, MenuButtonCommands]] = None, **extra_data: Any)[source]#
Use this method to change the bot’s menu button in a private chat, or the default menu button. Returns
True
on success.Source: https://core.telegram.org/bots/api#setchatmenubutton
- chat_id: Optional[int]#
Unique identifier for the target private chat. If not specified, default bot’s menu button will be changed
- menu_button: Optional[Union[MenuButtonDefault, MenuButtonWebApp, MenuButtonCommands]]#
A JSON-serialized object for the bot’s new menu button. Defaults to
aiogram.types.menu_button_default.MenuButtonDefault
Usage#
As bot method#
result: bool = await bot.set_chat_menu_button(...)
Method as object#
Imports:
from aiogram.methods.set_chat_menu_button import SetChatMenuButton
alias:
from aiogram.methods import SetChatMenuButton
With specific bot#
result: bool = await bot(SetChatMenuButton(...))
As reply into Webhook in handler#
return SetChatMenuButton(...)