Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

The node provides integration with Telegram via the TelePilot API, enabling automation and interaction with Telegram chats, messages, users, groups, files, and login sessions. Specifically, the Close Chat operation under the Chat resource allows the user to programmatically close a chat session in Telegram.

This node is beneficial for automating Telegram workflows such as managing chat sessions, sending or editing messages, handling media files, and controlling user interactions without manual intervention. For example, you can automatically close inactive chats, clean up sessions, or manage group memberships as part of a larger automation pipeline.

Properties

Name Meaning
Chat ID The unique identifier of the chat to be closed. This is required to specify which chat to close.

Output

The output is an array of JSON objects representing the response from the Telegram API after attempting to close the specified chat. The exact structure depends on the Telegram API's response but typically includes confirmation of the chat closure or error details if the operation failed.

No binary data output is involved in this operation.

Dependencies

  • Requires an active Telegram API credential (an API key and authentication token) configured in n8n.
  • Depends on the TelePilotNodeConnectionManager to manage Telegram client sessions and invoke API calls.
  • The node expects the Telegram account to be logged in; otherwise, it will throw an error prompting login.
  • No additional external services beyond Telegram are required.

Troubleshooting

  • Common Issues:

    • Attempting to close a chat when the Telegram session is not logged in or has expired will result in errors.
    • Invalid or missing Chat ID will cause the operation to fail.
    • Network issues or Telegram API restrictions may prevent successful chat closure.
  • Error Messages:

    • "Please login: https://telepilot.co/login-howto": Indicates the Telegram session is not authenticated. Resolve by performing login using the appropriate login operation.
    • "Session was closed or terminated. Please login again: https://telepilot.co/login-howto": The client session was closed unexpectedly; re-login is required.
    • "Unauthorized": The provided credentials are invalid or expired; re-authenticate.
    • Other Telegram API errors will be passed through; check the error message for specifics.
  • Resolution Tips:

    • Ensure the Telegram API credentials are correctly set up and valid.
    • Use the login operations before attempting chat management operations.
    • Verify the Chat ID is correct and accessible by the authenticated Telegram account.
    • Check network connectivity and Telegram service status.

Links and References

Discussion