Actions12
Overview
The "Leave Chat" operation in this Telegram Client node allows a user to leave a specified Telegram chat or channel. This is useful for automating the management of group memberships, such as leaving channels that are no longer relevant or managing multiple chat memberships programmatically.
Practical examples include:
- Automatically leaving promotional or notification channels after a certain event.
- Managing membership in large groups by leaving inactive or unwanted chats.
- Integrating with workflows that clean up chat memberships based on external triggers.
Properties
| Name | Meaning |
|---|---|
| Chat ID | The identifier or username of the chat or channel to leave (e.g., @username or -100xxxx). |
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 or username of the chat that was left.
Example output JSON:
{
"success": true,
"left": true,
"chatId": "@examplechannel"
}
Dependencies
- Requires an active Telegram Client API credential with valid session, API ID, and API hash.
- The node uses the Telegram Client SDK to connect and perform operations.
- Network connectivity to Telegram servers is necessary.
- No additional environment variables or configurations beyond the required credentials are needed.
Troubleshooting
Common issues:
- Invalid or missing credentials will cause authentication failure.
- Incorrect or non-existent chat ID may result in errors or failure to leave the chat.
- Network issues can prevent connection to Telegram servers.
Error messages:
"No credentials provided": Ensure that the Telegram Client API credentials are properly configured."Authentication failed: ...": Check that the session, API ID, and API hash are correct and valid."Operation 'leaveChat' is not supported": This should not occur if the operation is correctly selected; verify the node configuration.- Other errors from Telegram API (e.g., insufficient permissions) may be returned; review the error message for details.
Resolution tips:
- Verify credentials and re-authenticate if necessary.
- Confirm the chat ID is correct and accessible by the authenticated user.
- Ensure the bot or user account has permission to leave the chat.
- Check network connectivity and retry.
Links and References
- Telegram Client API Documentation
- Telegram Bots FAQ
- n8n Documentation (for general usage of the Telegram Client node)