Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

This node integrates with Telegram via the TelePilot API, enabling automation of various Telegram chat-related actions. Specifically, for the Chat resource and the Mark Chat as Unread operation, it allows users to toggle the unread status of a specified chat. This is useful in scenarios where you want to programmatically mark chats as unread to remind yourself or others to revisit them later.

Practical examples include:

  • Automatically marking important chats as unread when certain keywords appear.
  • Resetting the unread status after processing messages to manage notification workflows.
  • Integrating with other systems to flag chats that require follow-up.

Properties

Name Meaning
Chat ID The unique identifier of the chat to be marked as unread.
Mark as Unread? Boolean option to specify whether the chat should be marked as unread (true) or read (false).

Output

The node outputs a JSON array containing the response from the TelePilot API for the toggle action. The exact structure depends on the API response but generally includes confirmation of the chat's unread status change.

No binary data output is involved in this operation.

Dependencies

  • Requires an active Telegram API authentication token (API key credential) configured in n8n.
  • Depends on the TelePilotNodeConnectionManager to manage Telegram client sessions.
  • The node requires the user to be logged in to Telegram via the TelePilot login mechanism before performing chat operations.

Troubleshooting

  • Session Closed or Unauthorized Errors:
    If the error message "A closed client cannot be reused, create a new Client" or "Unauthorized" appears, it indicates the Telegram session has expired or was terminated. The solution is to re-authenticate using the login flow described at https://telepilot.co/login-howto.

  • Invalid Chat ID:
    Providing an incorrect or non-existent chat ID will cause the operation to fail. Verify the chat ID is correct and accessible by the authenticated Telegram account.

  • Missing Credentials:
    Ensure that the required Telegram API credentials are properly set up in n8n; otherwise, the node cannot connect to Telegram.

Links and References

Discussion