Telegram MTProto icon

Telegram MTProto

Full-featured Telegram MTProto client (Pyrogram equivalent)

Message → Get History

AI-generated

Summary

Retrieve the message history from a specified Telegram chat or channel, with options for pagination and filtering by message ID range.

Inputs

  • Chat ID / Username (required) — Identifier for the chat, channel, or user to fetch message history from; can be a chat ID, username starting with '@', or phone number.
  • Limit — Maximum number of messages to retrieve; defaults to 100 if not specified.
  • Additional Options — Optional parameters to control the message retrieval, including Offset ID for pagination, Min ID and Max ID to filter messages by ID range.

Output shape

a list of messages from the specified chat, each message including metadata as returned by the Telegram MTProto API

The retrieved messages respect the specified limit and optional offset, minimum, and maximum message ID filters. The output array corresponds to the fetched messages and can be empty if no messages match the criteria.

Discussion