Hide navigation sidebar
Hide table of contents sidebar
PTB has undergone significant changes in v20. Please read the documentation carefully and also check out the transition guide in the wiki.
Back to top
Toggle table of contents sidebar

# TextQuote

class telegram.TextQuote(text, position, entities=None, is_manual=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  This object contains information about the quoted part of a message that is replied to by the given message.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `text` and `position` are equal.

  Available In

  `telegram.Message.quote`

  New in version 20.8.

  Parameters:

    - text (`str`) – Text of the quoted part of a message that is replied to by the given message.

    - position (`int`) – Approximate quote position in the original message in UTF-16 code units as specified by the sender.

    - entities (Sequence[`telegram.MessageEntity`], optional) – Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes.

    - is_manual (`bool`, optional) – `True`, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.

  text

    Text of the quoted part of a message that is replied to by the given message.

    Type:

      `str`

  position

    Approximate quote position in the original message in UTF-16 code units as specified by the sender.

    Type:

      `int`

  entities

    Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes.

    Type:

      Tuple[`telegram.MessageEntity`]

  is_manual

    Optional. `True`, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.

    Type:

      `bool`

  classmethod de_json(data, bot)

    See `telegram.TelegramObject.de_json`.