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)[source]

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.

Added 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). Not supported for messages sent on behalf of a business account.

  • 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[source]

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[source]

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). Not supported for messages sent on behalf of a business account.

Type:

int | str

allow_sending_without_reply[source]

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[source]

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[source]

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

Type:

str

quote_entities[source]

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[source]

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

Type:

int

classmethod de_json(data, bot=None)[source]

See telegram.TelegramObject.de_json().