Telegram Client icon

Telegram Client

Use Telegram Client API

Overview

The "Leave Chat" operation in this Telegram Client node allows a user to leave a specified Telegram chat or channel. This is useful when automating the management of group memberships, for example, to programmatically exit groups or channels that are no longer relevant or needed.

Practical scenarios include:

  • Automatically leaving promotional or temporary groups after a certain event.
  • Managing membership cleanup in large-scale Telegram automation workflows.
  • Exiting channels as part of user preference updates or subscription changes.

Properties

Name Meaning
Chat ID The identifier of the chat or channel to leave. It can be a numeric ID (e.g., -100xxxx) or a username starting with '@'.

Output

The output JSON object contains the following fields:

  • success: A boolean indicating if the operation was successful (true).
  • left: A boolean confirming that the client has left the chat (true).
  • chatId: The ID of the chat or channel that was left.

Example output:

{
  "success": true,
  "left": true,
  "chatId": "@examplechannel"
}

Dependencies

  • Requires valid Telegram API credentials including an API ID, API hash, and a session string.
  • The node uses the Telegram Client API via a third-party SDK bundled within the node.
  • Network connectivity to Telegram servers is necessary.
  • Proper configuration of the Telegram API credentials in n8n is required before use.

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 correctly.
  • Invalid Chat ID: If the chat ID is incorrect or the bot/user does not have access to the chat, the operation may fail. Verify the chat/channel ID or username.
  • Connection issues: Network problems or Telegram server downtime can cause connection failures. Check your internet connection and retry later.
  • Permission errors: The authenticated user must have permission to leave the chat. For some channels or groups, restrictions might prevent leaving via API.

If the node is set to continue on failure, errors will be returned in the output JSON with a success: false flag and an error message.

Links and References

Discussion