Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

The Close Chat operation for the Chat resource in this custom n8n node is designed to interact with the Telegram API via a CoPilot integration. Specifically, it allows you to programmatically close a chat session by providing its unique Chat ID. This can be useful in automation scenarios where you want to manage or tidy up active chat sessions, such as after sending notifications, completing support conversations, or managing bot interactions.

Practical examples:

  • Automatically closing a chat after a workflow completes a customer support ticket.
  • Tidying up group or channel chats after automated announcements.
  • Managing chat state in complex multi-step Telegram bot workflows.

Properties

Display Name Type Description
Chat ID String ID of chat. Required. This is the unique identifier for the chat you wish to close (e.g., "122323").

Output

The output of the Close Chat operation is a JSON object containing the result of the close action from the Telegram API. The structure typically includes:

{
  "_": "closeChat",
  "chat_id": "<provided_chat_id>",
  // ...other fields as returned by the Telegram API
}
  • The exact fields may vary depending on the Telegram API's response, but at minimum, you will receive confirmation that the specified chat has been closed.

Dependencies

  • External Service: Requires access to the Telegram API via the TelePilot integration.
  • Credentials: You must configure and provide valid telePilotApi credentials in n8n, which include your Telegram API ID, API Hash, and phone number.
  • n8n Configuration: Ensure the TelePilot node is properly installed and configured within your n8n instance.

Troubleshooting

Common Issues:

  • Invalid Chat ID: If the provided Chat ID does not exist or is incorrect, the operation may fail or return an error from the Telegram API.
  • Session Not Logged In: If your Telegram session is not authenticated, you may see errors prompting you to log in again.
  • Permission Errors: If the bot/user does not have permission to close the chat, the API may return a "CHAT_WRITE_FORBIDDEN" or similar error.

Error Messages & Resolutions:

  • "Please login: https://telepilot.co/login-howto"
    Resolution: Re-authenticate your Telegram account using the provided guide.
  • "Session was closed or terminated. Please login again: https://telepilot.co/login-howto"
    Resolution: Your session expired; follow the login instructions to restore access.
  • "Cannot send messages to this chat. You may not have permission."
    Resolution: Check if the bot/user has sufficient permissions in the target chat.

Links and References

Discussion