BotCommandScope¶
- class telegram.BotCommandScope(type, *, api_kwargs=None)[source]¶
Bases:
telegram.TelegramObject
Base 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
type
is 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.
Use In
Added in version 13.7.
- ALL_CHAT_ADMINISTRATORS = 'all_chat_administrators'[source]¶
telegram.constants.BotCommandScopeType.ALL_CHAT_ADMINISTRATORS
- classmethod de_json(data, bot=None)[source]¶
Converts JSON data to the appropriate
BotCommandScope
object, 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.