Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

This node, named "Telegram CoPilot," integrates with the Telegram API to perform various Telegram-related actions programmatically. Specifically, for the Chat resource and the Search Public Chat (by Username) operation, it allows users to search for a public Telegram chat by providing its username.

Common scenarios where this node is beneficial include:

  • Automating the retrieval of public chat information on Telegram based on known usernames.
  • Integrating Telegram chat search functionality into workflows that require dynamic access to public chats.
  • Building bots or automation flows that need to verify or fetch details about public Telegram channels or groups by their usernames.

For example, a user can input a Telegram public chat username, and the node will return detailed information about that chat, which can then be used in subsequent workflow steps such as sending messages or joining the chat.

Properties

Name Meaning
Chat Username The username of the public Telegram chat to search for. This is a required string input.

Output

The node outputs an array of JSON objects representing the result of the invoked Telegram API method. For the searchPublicChat operation, the output JSON contains detailed information about the public chat found by the given username. This typically includes metadata such as chat ID, title, type (channel, group), and other relevant chat properties returned by Telegram's API.

If the node supports binary data output (not explicitly shown for this operation), it would represent files or media downloaded or processed, but for this operation, the output is purely JSON-based chat information.

Dependencies

  • Requires an active Telegram API authentication credential (an API key credential) configured in n8n.
  • Depends on the TelePilotNodeConnectionManager class to manage Telegram client sessions and API calls.
  • The node uses the Telegram TDLib API via a client instance managed internally.
  • Proper login/authentication must be established before performing operations; otherwise, the node throws errors prompting re-login.

Troubleshooting

  • Session Not Logged In: If the Telegram session is not logged in or has expired, the node will throw an error instructing the user to log in again using the provided guide URL (https://telepilot.co/login-howto). Ensure the login process is completed successfully before running operations.
  • Unauthorized Errors: These indicate invalid or expired credentials. Re-authenticate the Telegram account.
  • "A closed client cannot be reused" Error: This means the internal Telegram client session was closed unexpectedly. The node marks the client as closed and requires a new login.
  • Invalid Username: If the username does not correspond to any public chat, the output may be empty or contain an error response from Telegram.
  • Network Issues: Since the node communicates with Telegram servers, network connectivity problems can cause failures.

Links and References


This summary focuses on the Chat resource and the Search Public Chat (by Username) operation as requested.

Discussion