MenuButton¶
- class telegram.MenuButton(type, *, api_kwargs=None)[source]¶
Bases:
telegram.TelegramObjectThis object describes the bot’s menu button in a private chat. It should be one of
If a menu button other than
telegram.MenuButtonDefaultis set for a private chat, then it is applied in the chat. Otherwise the default menu button is applied. By default, the menu button opens the list of bot commands.Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their
typeis equal. For subclasses with additional attributes, the notion of equality is overridden.Returned In
Added in version 20.0.
- classmethod de_json(data, bot=None)[source]¶
Converts JSON data to the appropriate
MenuButtonobject, i.e. takes care of selecting the correct subclass.- Parameters:
bot (
telegram.Bot, optional) –The bot associated with this object. Defaults to
None, in which case shortcut methods will not be available.
- Returns:
The Telegram object.