Telegram Client icon

Telegram Client

Use Telegram Client API

Overview

The node provides integration with the Telegram Client API, enabling various chat-related operations within Telegram. Specifically, the Get Message History operation retrieves a list of messages from a specified chat or channel. This is useful for scenarios such as:

  • Archiving or backing up chat conversations.
  • Analyzing message content or activity in a chat.
  • Displaying recent chat history in dashboards or reports.
  • Automating responses based on past messages.

For example, a user can specify a chat ID and request the last 100 messages to review recent discussions or monitor chat activity.

Properties

Name Meaning
Chat ID The identifier or username of the chat/channel to retrieve messages from (e.g., @username or -100xxxx).
Options Additional parameters:
- Limit: Maximum number of messages to return (default 100).

Output

The output JSON contains:

  • success: Boolean indicating if the operation succeeded.
  • messages: An array of message objects retrieved from the chat history.

Each message object includes details such as message ID, date, sender info, text content, and any media attachments depending on the Telegram API response structure.

No binary data is output by this operation.

Example output snippet:

{
  "success": true,
  "messages": [
    {
      "id": 12345,
      "date": "2024-06-01T12:34:56Z",
      "text": "Hello, world!",
      ...
    },
    ...
  ]
}

Dependencies

  • Requires an active Telegram Client API credential with valid session, API ID, and API hash.
  • Uses the Telegram Client SDK internally to connect and perform operations.
  • Network access to Telegram servers is necessary.
  • No additional environment variables are required beyond the credential setup.

Troubleshooting

  • No credentials provided: The node will throw an error if the Telegram API credentials are missing or invalid. Ensure you have configured the required API authentication token/session correctly.
  • Connection issues: Network problems or incorrect API credentials may cause connection failures. Verify internet connectivity and credential validity.
  • Operation not supported: If an unsupported operation name is used, the node throws an error. Confirm that "getMessageHistory" is selected.
  • Limit parameter: Setting an excessively high limit may lead to timeouts or rate limiting by Telegram. Use reasonable limits (e.g., 100).
  • Chat ID format: Incorrect chat IDs or usernames will result in errors. Use correct formats like @username or numeric IDs starting with -100.

Links and References

Discussion