Telematic icon

Telematic

Use Telegram Client API

Overview

The node interacts with the Telegram Client API to perform various chat-related operations. Specifically, the "Get Chat Members" operation retrieves a list of members from a specified Telegram chat or channel. This is useful for scenarios where you need to analyze or manage participants in a group, such as sending targeted messages, auditing membership, or integrating member data into other workflows.

Practical examples:

  • Fetching all members of a Telegram group to export their usernames and IDs.
  • Monitoring membership changes by periodically retrieving the member list.
  • Integrating Telegram group members into a CRM or mailing list.

Properties

Name Meaning
Chat ID The identifier or username of the chat/channel (e.g., @username or -100xxxx) to query.
Options Additional parameters:
- Silent: (boolean) Not applicable here but generally used to send messages silently.
- Caption: (string) Caption for media messages (not relevant for this operation).
- Parse Mode: (None, Markdown, HTML) How to parse message text (not relevant here).
- Limit: (number) Maximum number of chat members to return (default 100).

Output

The output JSON contains:

  • success: Boolean indicating if the operation succeeded.
  • members: An array of member objects representing the participants of the chat. Each member object includes details as returned by the Telegram client library (such as user ID, username, status, etc.).

Example output structure:

{
  "success": true,
  "members": [
    {
      "id": 123456789,
      "username": "exampleuser",
      "status": "member",
      ...
    },
    ...
  ]
}

No binary data is output by this operation.

Dependencies

  • Requires an API key credential with Telegram API credentials (apiId and apiHash).
  • Uses the Telegram Client API via a Telegram client library bundled with the node.
  • The node must be configured with valid Telegram API credentials to authenticate and connect.
  • Network access to Telegram servers is required.

Troubleshooting

  • Common issues:
    • Missing or invalid Telegram API credentials will cause authentication failure.
    • Incorrect or inaccessible Chat ID (e.g., private groups without access) may result in errors or empty member lists.
    • Exceeding Telegram API rate limits can cause temporary failures.
  • Error messages:
    • "No credentials provided": Ensure that the Telegram API credentials are set up correctly in n8n.
    • "Operation \"getChatMembers\" is not supported": Indicates a misconfiguration or unsupported operation; verify the selected operation.
    • Connection errors: Check network connectivity and validity of API credentials.
  • To resolve errors, verify credentials, ensure the bot/user has access to the chat, and check Telegram API usage limits.

Links and References

Discussion