telegram.BotCommandScope
- class telegram.BotCommandScope(type, **_kwargs)
Bases:
telegram.base.TelegramObjectBase class for objects that represent the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
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.Note
Please see the official docs on how Telegram determines which commands to display.
New in version 13.7.
- Parameters
type (
str) – Scope type.
- type
Scope type.
- Type
str
- ALL_CHAT_ADMINISTRATORS = 'all_chat_administrators'
telegram.constants.BOT_COMMAND_SCOPE_ALL_CHAT_ADMINISTRATORS
- ALL_GROUP_CHATS = 'all_group_chats'
- ALL_PRIVATE_CHATS = 'all_private_chats'
- CHAT = 'chat'
- CHAT_ADMINISTRATORS = 'chat_administrators'
- CHAT_MEMBER = 'chat_member'
- DEFAULT = 'default'
- classmethod de_json(data, bot)
Converts JSON data to the appropriate
BotCommandScopeobject, i.e. takes care of selecting the correct subclass.- Parameters
data (Dict[
str, …]) – The JSON data.bot (
telegram.Bot) – The bot associated with this object.
- Returns
The Telegram object.