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

# ReplyParameters

class telegram.ReplyParameters(message_id, chat_id=None, allow_sending_without_reply=None, quote=None, quote_parse_mode=None, quote_entities=None, quote_position=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  Describes reply parameters for the message that is being sent.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `message_id` is equal.

  Use In

  - `telegram.Bot.copy_message()`

  - `telegram.Bot.send_animation()`

  - `telegram.Bot.send_audio()`

  - `telegram.Bot.send_contact()`

  - `telegram.Bot.send_dice()`

  - `telegram.Bot.send_document()`

  - `telegram.Bot.send_game()`

  - `telegram.Bot.send_invoice()`

  - `telegram.Bot.send_location()`

  - `telegram.Bot.send_media_group()`

  - `telegram.Bot.send_message()`

  - `telegram.Bot.send_photo()`

  - `telegram.Bot.send_poll()`

  - `telegram.Bot.send_sticker()`

  - `telegram.Bot.send_venue()`

  - `telegram.Bot.send_video_note()`

  - `telegram.Bot.send_video()`

  - `telegram.Bot.send_voice()`

  New in version 20.8.

  Parameters:

    - message_id (`int`) – Identifier of the message that will be replied to in the current chat, or in the chat `chat_id` if it is specified.

    - chat_id (`int` | `str`, optional) – If the message to be replied to is from a different chat, Unique identifier for the target chat or username of the target channel (in the format `@channelusername`).

    - allow_sending_without_reply (`bool`, optional) – Pass `True`, if the message should be sent even if the specified replied-to message is not found. Can be used only for replies in the same chat and forum topic.

    - quote (`str`, optional) – Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn’t found in the original message.

    - quote_parse_mode (`str`, optional) – Mode for parsing entities in the quote. See formatting options for more details.

    - quote_entities (Sequence[`telegram.MessageEntity`], optional) – A JSON-serialized list of special entities that appear in the quote. It can be specified instead of `quote_parse_mode`.

    - quote_position (`int`, optional) – Position of the quote in the original message in UTF-16 code units.

  message_id

    Identifier of the message that will be replied to in the current chat, or in the chat `chat_id` if it is specified.

    Type:

      `int`

  chat_id

    Optional. If the message to be replied to is from a different chat, Unique identifier for the target chat or username of the target channel (in the format `@channelusername`).

    Type:

      `int` | `str`

  allow_sending_without_reply

    Optional. Pass `True`, if the message should be sent even if the specified replied-to message is not found. Can be used only for replies in the same chat and forum topic.

    Type:

      `bool`

  quote

    Optional. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn’t found in the original message.

    Type:

      `str`

  quote_parse_mode

    Optional. Mode for parsing entities in the quote. See formatting options for more details.

    Type:

      `str`

  quote_entities

    Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of `quote_parse_mode`.

    Type:

      Tuple[`telegram.MessageEntity`]

  quote_position

    Optional. Position of the quote in the original message in UTF-16 code units.

    Type:

      `int`

  classmethod de_json(data, bot)

    See `telegram.TelegramObject.de_json`.