Telegram MTProto Client icon

Telegram MTProto Client

Use Telegram Client API with MTProto protocol

Get Chat Members

AI-generated

Overview

This node integrates with the Telegram MTProto Client API, enabling interaction with Telegram chats and users through various operations. Specifically, the "Get Chat Members" operation retrieves a list of members from a specified chat or channel. This is useful for scenarios such as managing group memberships, auditing participants, or automating user-related workflows in Telegram groups or channels.

Practical examples include:

  • Fetching all members of a team chat to send targeted notifications.
  • Auditing membership lists for compliance or moderation purposes.
  • Integrating Telegram group member data into CRM or analytics platforms.

Properties

Name Meaning
Chat ID The identifier or username of the chat/channel to query members from (e.g., @username or -100xxxx).
Options Additional optional parameters:
• Silent: Send messages silently without notification (not applicable here).
• Caption: Caption for media messages (not applicable here).
• Parse Mode: How to parse message text (not applicable here).
• Limit: Maximum number of chat members to return (default 100).

Note: For the "Get Chat Members" operation, only the Chat ID and the Limit option are relevant.

Output

The output JSON contains:

  • success: Boolean indicating if the operation succeeded.
  • members: An array of chat member objects representing the participants retrieved from the specified chat. Each member object includes details about the user in the chat.

Example output structure:

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

No binary data is output by this operation.

Dependencies

  • Requires an active Telegram MTProto API session authenticated via credentials containing an API ID, API hash, and a session string.
  • The node uses the Telegram MTProto protocol client library bundled within the node's SDK.
  • Network connectivity to Telegram servers is required.
  • No additional environment variables or external services beyond Telegram API access are needed.

Troubleshooting

  • Missing Credentials: If no valid Telegram API credentials are provided, the node will throw an error "No credentials provided". Ensure that the API ID, API hash, and session string are correctly configured.
  • Invalid Chat ID: Providing an incorrect or inaccessible chat ID or username may result in errors or empty member lists. Verify the chat identifier format and permissions.
  • Limit Exceeded: The limit option controls how many members are fetched. Setting it too high might cause performance issues or API rate limits.
  • Connection Issues: Network problems or Telegram server issues can cause connection failures. The node attempts retries but persistent failures should be checked.
  • Permission Restrictions: The authenticated account must have permission to view the chat members; otherwise, the operation may fail or return incomplete data.

Links and References

Discussion