telegram.BotCommandScope

class telegram.BotCommandScope(type, **_kwargs)

Bases: telegram.base.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.

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'

telegram.constants.BOT_COMMAND_SCOPE_ALL_GROUP_CHATS

ALL_PRIVATE_CHATS = 'all_private_chats'

telegram.constants.BOT_COMMAND_SCOPE_ALL_PRIVATE_CHATS

CHAT = 'chat'

telegram.constants.BOT_COMMAND_SCOPE_CHAT

CHAT_ADMINISTRATORS = 'chat_administrators'

telegram.constants.BOT_COMMAND_SCOPE_CHAT_ADMINISTRATORS

CHAT_MEMBER = 'chat_member'

telegram.constants.BOT_COMMAND_SCOPE_CHAT_MEMBER

DEFAULT = 'default'

telegram.constants.BOT_COMMAND_SCOPE_DEFAULT

classmethod de_json(data, bot)

Converts JSON data to the appropriate BotCommandScope object, 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.