Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

The node "Telegram CoPilot" provides a comprehensive interface to interact with Telegram via its API, enabling automation of various Telegram operations. Specifically for the Message resource and the Get Messages operation, it allows retrieving detailed information about specific messages within a chat by their identifiers.

This node is beneficial in scenarios such as:

  • Fetching message details for processing or logging.
  • Automating workflows that depend on message content or metadata.
  • Integrating Telegram messaging data into other systems or databases.

For example, you can use this node to get the content and metadata of a particular message in a chat to trigger further actions like analytics, notifications, or archiving.

Properties

Name Meaning
Chat ID The unique identifier of the chat where the message resides. Required for message lookup.
Message ID The unique identifier of the message to retrieve within the specified chat.

These properties must be provided to specify exactly which message to fetch from Telegram.

Output

The output is a JSON array containing the result(s) of the invoked Telegram API call. For the "Get Messages" operation, the JSON object includes detailed information about the requested message, such as:

  • Message content (text, media, etc.)
  • Sender information
  • Timestamps
  • Message status and metadata

No binary data output is indicated for this operation.

Example output structure (simplified):

[
  {
    "id": 12345678,
    "chat_id": 122323,
    "sender_user_id": 987654,
    "content": {
      "_": "messageText",
      "text": {
        "_": "formattedText",
        "text": "Hello, world!"
      }
    },
    "date": 1680000000,
    "is_outgoing": true,
    ...
  }
]

Dependencies

  • Requires an active Telegram API authentication token (API key credential) configured in n8n.
  • Depends on the TelePilot library and its connection manager to handle Telegram client sessions.
  • The node requires proper login/authentication to Telegram before performing message retrieval.
  • Network access to Telegram servers is necessary.

Troubleshooting

  • Common issues:

    • Unauthorized errors if the Telegram session is not logged in or expired.
    • Errors related to closed client sessions requiring re-login.
    • Invalid or missing Chat ID or Message ID parameters causing failures.
  • Error messages and resolutions:

    • "Please login: https://telepilot.co/login-howto": Indicates the Telegram session is not authenticated. Resolve by performing the login operation using the node's login commands.
    • "Session was closed or terminated. Please login again: https://telepilot.co/login-howto": The client session has been closed; re-authenticate.
    • "A closed client cannot be reused, create a new Client": Similar to above, requires re-login.
    • "Unauthorized": Credentials are invalid or expired; reauthenticate.

Ensure the Chat ID and Message ID are correct and correspond to existing entities in your Telegram account.

Links and References

Discussion