Skip to main content

Get Messages

Retrieves messages from a specified Telegram chat.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Client Id - The unique identifier of the Telegram client to use for this operation.
  • Chat - The chat from which to retrieve messages (can be a username, chat ID, or other chat identifier).
  • Limit - The maximum number of messages to retrieve (must be greater than 0).

Output

  • Messages - An array of message objects containing message information.

How It Works

The Get Messages node retrieves messages from a specified Telegram chat. When executed, the node:

  1. Validates the provided inputs (Client Id, Chat, and Limit)
  2. Uses the Telegram client to fetch messages from the specified chat
  3. Processes each message to extract relevant information:
    • ID
    • Sender ID
    • Message text
    • Date and time
    • Whether the message contains a photo
    • From ID (if applicable)
  4. Returns the list of messages as output

Requirements

  • A valid Telegram client session with appropriate permissions
  • Valid Chat identifier
  • Valid Limit value (greater than 0)
  • Client Id must match an existing Telegram client session

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Client Id
  • Empty or invalid Chat identifier
  • Limit value less than or equal to 0

Usage Notes

  • The Chat parameter can accept various identifiers such as usernames, chat IDs, or other chat references
  • The Limit parameter controls how many messages are retrieved in a single call
  • The output contains detailed information about each message including metadata
  • Message objects include information about whether they contain photos
  • The Client Id must correspond to an active Telegram client session