get_replied_message()#

Client.get_replied_message()#

Returns information about a non-bundled message that is replied by a given message.

Usable by Users Bots

Also, returns the pinned message, the game message, the invoice message, the message with a previously set same background, the giveaway message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messageGiveawayCompleted and topic messages without non-bundled replied message respectively.

Parameters:
  • chat_id (int | str) – Unique identifier (int) or username (str) of the target chat. For your personal cloud (Saved Messages) you can simply use “me” or “self”. For a contact that exists in your Telegram address book you can use his phone number (str).

  • message_ids (int | Iterable of int) – Pass a single message identifier or an iterable of message ids (as integers) to get the content of the previous message you replied to using this message.

  • replies (int, optional) – The number of subsequent replies to get for each message. Pass 0 for no reply at all or -1 for unlimited replies. Defaults to 1.

Example

# Get the replied-to message of a message
await app.get_replied_message(chat_id=chat_id, message_ids=message_id)