Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

The Search Public Chat (by Username) operation in the "Chat" resource of this custom n8n node allows you to search for a public Telegram chat using its username. This is useful when you want to retrieve information about a specific public group, channel, or user chat by providing their Telegram username.

Common scenarios:

  • Automating workflows that require fetching details about a public Telegram group or channel.
  • Validating if a given username corresponds to an existing public chat.
  • Integrating Telegram chat lookups into CRM, support, or notification systems.

Example use case:
You have a list of Telegram usernames and want to enrich your database with metadata about each corresponding public chat.

Properties

Display Name Type Description
Chat Username String Username to use in searchPublicChat. This should be the Telegram username (without @) of the public chat you wish to find. Required.

Output

The output will be a JSON object containing the details of the found public chat. The structure is determined by the Telegram API's searchPublicChat response and typically includes fields such as:

{
  "id": 123456789,
  "type": { /* chat type info */ },
  "title": "Sample Group",
  "username": "samplegroup",
  "photo": { /* photo info */ },
  "last_message": { /* last message info */ },
  // ...other Telegram chat properties
}

If the username does not correspond to any public chat, the result may be empty or contain an error message.

Dependencies

  • Telegram Account: You must provide valid Telegram API credentials (apiId, apiHash, and phoneNumber) via the required credential named telePilotApi.
  • External Service: Requires access to the Telegram API.
  • n8n Configuration: No special configuration beyond setting up the credentials.

Troubleshooting

Common issues:

  • Invalid or non-existent username: If the provided username does not match any public chat, the output will be empty or may include an error.
  • Authentication errors: If your Telegram credentials are invalid or the session has expired, you may receive errors like "Please login: https://telepilot.co/login-howto".
  • Session closed: If the session was terminated, you might see "Session was closed or terminated. Please login again".

How to resolve:

  • Double-check the username for typos and ensure it refers to a public chat.
  • Make sure your Telegram credentials are correct and the account is logged in.
  • If you encounter session errors, follow the login instructions at https://telepilot.co/login-howto.

Links and References

Discussion