getChatMenuButton¶
Returns: Union[MenuButtonDefault, MenuButtonWebApp, MenuButtonCommands]
- class aiogram.methods.get_chat_menu_button.GetChatMenuButton(*, chat_id: int | None = None, **extra_data: Any)[source]¶
Use this method to get the current value of the bot’s menu button in a private chat, or the default menu button. Returns
aiogram.types.menu_button.MenuButton
on success.Source: https://core.telegram.org/bots/api#getchatmenubutton
- chat_id: int | None¶
Unique identifier for the target private chat. If not specified, default bot’s menu button will be returned
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_post_init(context: Any, /) → None¶
We need to both initialize private attributes and call the user-defined model_post_init method.
Usage¶
As bot method¶
result: Union[MenuButtonDefault, MenuButtonWebApp, MenuButtonCommands] = await bot.get_chat_menu_button(...)
Method as object¶
Imports:
from aiogram.methods.get_chat_menu_button import GetChatMenuButton
alias:
from aiogram.methods import GetChatMenuButton
With specific bot¶
result: Union[MenuButtonDefault, MenuButtonWebApp, MenuButtonCommands] = await bot(GetChatMenuButton(...))