diff --git a/telegram/_messageentity.py b/telegram/_messageentity.py index 1ddcc66047e..fd7a282c1f9 100644 --- a/telegram/_messageentity.py +++ b/telegram/_messageentity.py @@ -45,12 +45,15 @@ class MessageEntity(TelegramObject): :attr:`EMAIL` (do-not-reply@telegram.org), :attr:`PHONE_NUMBER` (+1-212-555-0123), :attr:`BOLD` (**bold text**), :attr:`ITALIC` (*italic text*), :attr:`UNDERLINE` (underlined text), :attr:`STRIKETHROUGH`, :attr:`SPOILER` (spoiler message), - :attr:`CODE` (monowidth string), :attr:`PRE` (monowidth block), :attr:`TEXT_LINK` - (for clickable text URLs), :attr:`TEXT_MENTION` (for users without usernames), - :attr:`CUSTOM_EMOJI` (for inline custom emoji stickers). + :attr:`BLOCKQUOTE` (block quotation), :attr:`CODE` (monowidth string), :attr:`PRE` + (monowidth block), :attr:`TEXT_LINK` (for clickable text URLs), :attr:`TEXT_MENTION` + (for users without usernames), :attr:`CUSTOM_EMOJI` (for inline custom emoji stickers). .. versionadded:: 20.0 Added inline custom emoji + + .. versionadded:: NEXT.VERSION + Added block quotation offset (:obj:`int`): Offset in UTF-16 code units to the start of the entity. length (:obj:`int`): Length of the entity in UTF-16 code units. url (:obj:`str`, optional): For :attr:`TEXT_LINK` only, url that will be opened after @@ -71,12 +74,15 @@ class MessageEntity(TelegramObject): :attr:`EMAIL` (do-not-reply@telegram.org), :attr:`PHONE_NUMBER` (+1-212-555-0123), :attr:`BOLD` (**bold text**), :attr:`ITALIC` (*italic text*), :attr:`UNDERLINE` (underlined text), :attr:`STRIKETHROUGH`, :attr:`SPOILER` (spoiler message), - :attr:`CODE` (monowidth string), :attr:`PRE` (monowidth block), :attr:`TEXT_LINK` - (for clickable text URLs), :attr:`TEXT_MENTION` (for users without usernames), - :attr:`CUSTOM_EMOJI` (for inline custom emoji stickers). + :attr:`BLOCKQUOTE` (block quotation), :attr:`CODE` (monowidth string), :attr:`PRE` + (monowidth block), :attr:`TEXT_LINK` (for clickable text URLs), :attr:`TEXT_MENTION` + (for users without usernames), :attr:`CUSTOM_EMOJI` (for inline custom emoji stickers). .. versionadded:: 20.0 Added inline custom emoji + + .. versionadded:: NEXT.VERSION + Added block quotation offset (:obj:`int`): Offset in UTF-16 code units to the start of the entity. length (:obj:`int`): Length of the entity in UTF-16 code units. url (:obj:`str`): Optional. For :attr:`TEXT_LINK` only, url that will be opened after @@ -174,5 +180,10 @@ def de_json(cls, data: Optional[JSONDict], bot: "Bot") -> Optional["MessageEntit .. versionadded:: 20.0 """ + BLOCKQUOTE: Final[str] = constants.MessageEntityType.BLOCKQUOTE + """:const:`telegram.constants.MessageEntityType.BLOCKQUOTE` + + .. versionadded:: NEXT.VERSION + """ ALL_TYPES: Final[List[str]] = list(constants.MessageEntityType) """List[:obj:`str`]: A list of all available message entity types.""" diff --git a/telegram/constants.py b/telegram/constants.py index 24fae12d485..d0e983291e1 100644 --- a/telegram/constants.py +++ b/telegram/constants.py @@ -1565,6 +1565,11 @@ class MessageEntityType(StringEnum): .. versionadded:: 20.0 """ + BLOCKQUOTE = "blockquote" + """:obj:`str`: Message entities representing a block quotation. + + .. versionadded:: NEXT.VERSION + """ class MessageLimit(IntEnum):