Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

This node, named "Telegram CoPilot," provides an interface to interact with Telegram via the TelePilot API. It supports a wide range of Telegram operations such as managing user sessions, retrieving chat information, sending messages, handling files, and more.

Specifically, for the Chat resource and the Search Public Chat (by Username) operation, the node allows users to search for a public Telegram chat by its username. This is useful when you want to find and interact with public channels or groups on Telegram by their known usernames.

Practical scenarios include:

  • Automating the discovery of public Telegram channels or groups by username.
  • Integrating Telegram chat search into workflows that require fetching chat metadata before sending messages or performing other actions.
  • Building bots or automation that dynamically locate chats based on usernames provided at runtime.

Properties

Name Meaning
Chat Username The username of the public Telegram chat to search for. This should be the exact username string of the public chat you want to find.

Output

The output is a JSON array containing the result of the searchPublicChat API call. The structure typically includes detailed information about the found public chat, such as its ID, title, type (channel, group), and other metadata returned by the Telegram API.

No binary data output is involved in this operation.

Example output snippet (conceptual):

[
  {
    "id": 123456789,
    "type": "channel",
    "title": "Example Channel",
    "username": "examplechannel",
    "status": "member"
  }
]

Dependencies

  • Requires an active Telegram API credential configured in n8n, which includes necessary authentication tokens (API ID, API hash, phone number).
  • Depends on the TelePilotNodeConnectionManager to manage Telegram client sessions.
  • The node requires the user to be logged in to Telegram via the node's login mechanism before performing chat operations.
  • Network access to Telegram servers is required.

Troubleshooting

  • Not logged in / Unauthorized errors: If the node throws errors indicating unauthorized access or closed client sessions, it means the Telegram session is not active. Users must perform the login operation first using the node’s login functionality.
  • Session closed or terminated: The node may throw an error suggesting to log in again if the session was closed or expired.
  • Invalid username: Searching for a non-existent or misspelled username will likely return empty results or an error.
  • Rate limits or API restrictions: Excessive requests might be throttled by Telegram; handle such cases by adding delays or retries.
  • Command usage: For login-related commands, users should follow the instructions at https://telepilot.co/login-howto.

Links and References

Discussion