This object represents a bot command. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`command` and :attr:`description` are equal. Args: command (:obj:`str`): Text of the command; :tg-const:`telegram
| 26 | |
| 27 | |
| 28 | class BotCommand(TelegramObject): |
| 29 | """ |
| 30 | This object represents a bot command. |
| 31 | |
| 32 | Objects of this class are comparable in terms of equality. Two objects of this class are |
| 33 | considered equal, if their :attr:`command` and :attr:`description` are equal. |
| 34 | |
| 35 | Args: |
| 36 | command (:obj:`str`): Text of the command; :tg-const:`telegram.BotCommand.MIN_COMMAND`- |
| 37 | :tg-const:`telegram.BotCommand.MAX_COMMAND` characters. Can contain only lowercase |
| 38 | English letters, digits and underscores. |
| 39 | description (:obj:`str`): Description of the command; |
| 40 | :tg-const:`telegram.BotCommand.MIN_DESCRIPTION`- |
| 41 | :tg-const:`telegram.BotCommand.MAX_DESCRIPTION` characters. |
| 42 | |
| 43 | Attributes: |
| 44 | command (:obj:`str`): Text of the command; :tg-const:`telegram.BotCommand.MIN_COMMAND`- |
| 45 | :tg-const:`telegram.BotCommand.MAX_COMMAND` characters. Can contain only lowercase |
| 46 | English letters, digits and underscores. |
| 47 | description (:obj:`str`): Description of the command; |
| 48 | :tg-const:`telegram.BotCommand.MIN_DESCRIPTION`- |
| 49 | :tg-const:`telegram.BotCommand.MAX_DESCRIPTION` characters. |
| 50 | |
| 51 | """ |
| 52 | |
| 53 | __slots__ = ("command", "description") |
| 54 | |
| 55 | def __init__(self, command: str, description: str, *, api_kwargs: JSONDict | None = None): |
| 56 | super().__init__(api_kwargs=api_kwargs) |
| 57 | self.command: str = command |
| 58 | self.description: str = description |
| 59 | |
| 60 | self._id_attrs = (self.command, self.description) |
| 61 | |
| 62 | self._freeze() |
| 63 | |
| 64 | MIN_COMMAND: Final[int] = constants.BotCommandLimit.MIN_COMMAND |
| 65 | """:const:`telegram.constants.BotCommandLimit.MIN_COMMAND` |
| 66 | |
| 67 | .. versionadded:: 20.0 |
| 68 | """ |
| 69 | MAX_COMMAND: Final[int] = constants.BotCommandLimit.MAX_COMMAND |
| 70 | """:const:`telegram.constants.BotCommandLimit.MAX_COMMAND` |
| 71 | |
| 72 | .. versionadded:: 20.0 |
| 73 | """ |
| 74 | MIN_DESCRIPTION: Final[int] = constants.BotCommandLimit.MIN_DESCRIPTION |
| 75 | """:const:`telegram.constants.BotCommandLimit.MIN_DESCRIPTION` |
| 76 | |
| 77 | .. versionadded:: 20.0 |
| 78 | """ |
| 79 | MAX_DESCRIPTION: Final[int] = constants.BotCommandLimit.MAX_DESCRIPTION |
| 80 | """:const:`telegram.constants.BotCommandLimit.MAX_DESCRIPTION` |
| 81 | |
| 82 | .. versionadded:: 20.0 |
| 83 | """ |
no outgoing calls
searching dependent graphs…