Telegram Client icon

Telegram Client

Use Telegram Client API

Overview

This node interacts with the Telegram Client API to perform various chat-related operations. Specifically, the "Get Message History" operation retrieves the message history from a specified Telegram chat or channel. This is useful for scenarios where you want to analyze past conversations, archive messages, or trigger workflows based on historical chat data.

Practical examples include:

  • Extracting recent messages from a support channel to analyze customer inquiries.
  • Archiving chat history for compliance or record-keeping.
  • Monitoring conversations in a group or channel for specific keywords or events.

Properties

Name Meaning
Chat ID The identifier of the chat or channel from which to retrieve message history. Can be a username (e.g., @username) or a numeric ID (e.g., -100xxxx).
Options Additional parameters to customize the request:
- Silent: Not applicable for this operation (used in sending messages).
- Caption: Not applicable here.
- Parse Mode: Not applicable here.
- Limit: Maximum number of messages to return (default is 100).

Output

The output JSON contains the following structure:

{
  "success": true,
  "messages": [
    {
      // Each message object as returned by the Telegram Client API
    }
  ]
}
  • success: Boolean indicating if the operation was successful.
  • messages: An array of message objects representing the retrieved message history from the specified chat. Each message includes details such as message ID, date, sender, content, and other metadata as provided by the Telegram API.

The node does not output binary data for this operation.

Dependencies

  • Requires an active Telegram Client API credential with valid session, API ID, and API hash.
  • The node uses the Telegram Client SDK internally to connect and fetch messages.
  • Network connectivity to Telegram servers is necessary.
  • No additional environment variables are required beyond the configured credentials.

Troubleshooting

  • No credentials provided: The node will throw an error if the Telegram Client API credentials are missing or invalid. Ensure that the API ID, API hash, and session string are correctly set up.
  • Connection issues: If the node cannot connect to Telegram, verify network access and that the credentials have not expired or been revoked.
  • Limit parameter: Setting the limit too high may cause delays or timeouts; use reasonable values (default 100).
  • Invalid Chat ID: Providing an incorrect or inaccessible chat ID will result in errors or empty results. Double-check the chat identifier format.
  • API rate limits: Frequent requests might hit Telegram's rate limits; implement retries or backoff strategies if needed.
  • If the node encounters an error during execution and "Continue On Fail" is enabled, it will output the error message in the JSON response instead of stopping the workflow.

Links and References

Discussion