Actions26
- Chat Actions
- File Actions
- Group Actions
- Message Actions
- User Actions
Overview
The node provides integration with Telegram via the TelePilot API, enabling automation of various Telegram chat-related actions. Specifically, the Close Chat operation allows users to programmatically close a chat session in Telegram. This can be useful for managing active chats, cleaning up sessions, or automating workflows that require closing chats after certain interactions.
Practical examples include:
- Automatically closing a customer support chat once the issue is resolved.
- Closing inactive group chats as part of a cleanup routine.
- Managing chat lifecycle in bots that handle multiple conversations.
Properties
| Name | Meaning |
|---|---|
| Chat ID | The unique identifier of the chat to close. This is required to specify which chat session should be closed. Example: "122323" |
Output
The node outputs a JSON array containing the response from the Telegram API after attempting to close the specified chat. The structure typically includes details about the chat closure status or any relevant metadata returned by the Telegram client.
No binary data output is involved in this operation.
Example output snippet (conceptual):
[
{
"_": "ok",
"chat_id": "122323",
"status": "closed"
}
]
Dependencies
- Requires an active Telegram API credential configured in n8n, including necessary authentication tokens.
- Depends on the TelePilotNodeConnectionManager to manage Telegram client sessions and invoke API calls.
- The node expects the Telegram account to be logged in and authorized; otherwise, it will throw errors prompting re-login.
Troubleshooting
Error: Session was closed or terminated. Please login again:
This indicates the Telegram client session has expired or been closed. Resolve by re-authenticating using the login flow described at https://telepilot.co/login-howto.Error: Please login:
The node cannot perform operations without a valid Telegram session. Use the login commands or nodes to authenticate before running chat operations.Invalid Chat ID or Chat Not Found:
If the provided Chat ID does not exist or is incorrect, the operation may fail. Verify the Chat ID is correct and accessible by the authenticated Telegram account.Unauthorized:
Indicates missing or invalid credentials. Check that the API key and authentication tokens are correctly set up in n8n.
Links and References
- TelePilot Login Guide — Instructions for authenticating your Telegram account.
- Telegram API Documentation — Official Telegram API reference.
- TelePilot GitHub Repository — Source code and additional resources for TelePilot.