Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

The Get Messages operation for the Message resource in this custom n8n node allows you to retrieve a specific message from a Telegram chat using the TelePilot integration. This is useful for automating workflows that need to fetch and process individual messages, such as archiving important communications, monitoring chat activity, or triggering actions based on message content.

Practical examples:

  • Fetching a message by its ID for further analysis or logging.
  • Retrieving a message to extract attachments or text for downstream processing.
  • Monitoring specific chats for new or updated messages.

Properties

Display Name Type Description
Chat ID String ID of the chat where the message resides.
Message ID String Identifier of the message to be retrieved.

Both properties are required for this operation.

Output

The output will be a JSON object representing the Telegram message retrieved. The structure typically includes:

{
  "id": <number>,                // Unique identifier for the message
  "chat_id": <number>,           // ID of the chat containing the message
  "date": <number>,              // Unix timestamp of when the message was sent
  "sender_user_id": <number>,    // User ID of the sender
  "content": { ... },            // Object describing the message content (text, media, etc.)
  // ...other Telegram message fields
}
  • The exact fields depend on the Telegram API's response for the getMessage method.
  • If the message contains media (photo, document, etc.), relevant metadata will be included in the content field.

Dependencies

  • External Service: Requires access to the Telegram API via the TelePilot backend.
  • Credentials: You must configure the telePilotApi credential in n8n, which includes your Telegram API ID, API Hash, and phone number.
  • n8n Configuration: No special environment variables are needed beyond the credential setup.

Troubleshooting

Common Issues:

  • Invalid Chat ID or Message ID: If either ID is incorrect or does not exist, the node may return an error or an empty result.
  • Session Expired/Unauthorized: If your Telegram session has expired or is unauthorized, you may see errors like:
    • "Session was closed or terminated. Please login again: https://telepilot.co/login-howto"
    • "Please login: https://telepilot.co/login-howto"
      To resolve, re-authenticate your TelePilot credentials as per the provided link.
  • API Errors: If the Telegram API returns an error (e.g., due to permissions), the error message will be surfaced in the node output.

How to resolve:

  • Double-check that both Chat ID and Message ID are correct and accessible with your account.
  • Ensure your TelePilot credentials are valid and the session is active.
  • If you encounter persistent issues, try logging out and back in via the TelePilot login flow.

Links and References


This summary focuses specifically on the Message resource and the Get Messages operation, as requested.

Discussion