Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

The Forward Messages operation of the Message resource in this custom n8n node allows you to forward one or more messages from a source chat to a target chat on Telegram. This is useful for automating workflows where information needs to be relayed between different chats, groups, or channels without manual intervention.

Common scenarios:

  • Automatically forwarding important notifications from a private group to a public channel.
  • Relaying user-submitted content from one chat to another for moderation or archival.
  • Building bots that aggregate messages from multiple sources into a single chat.

Example:
If you want to automatically forward all messages with certain keywords from a support chat to an admin group, you can use this operation as part of your n8n workflow.


Properties

Below are the input properties relevant to the "Forward Messages" operation:

Display Name Type Description
Chat ID String ID of the chat where the messages will be forwarded to.
From Chat ID String ID of the chat from which to forward messages.
Message IDs String Comma-separated list of message identifiers to be forwarded.

Details:

  • Chat ID: The destination chat's unique identifier (e.g., -1001234567890).
  • From Chat ID: The source chat's unique identifier from which messages will be taken.
  • Message IDs: A string like 123,234,345 specifying which messages to forward.

Output

The output is a JSON object (or array) containing the result of the forward operation as returned by the Telegram API. The structure typically includes:

{
  "_": "forwardMessages",
  "chat_id": "<destination_chat_id>",
  "from_chat_id": "<source_chat_id>",
  "message_ids": ["<id1>", "<id2>", ...],
  // Additional fields as provided by Telegram API response
}
  • The exact structure may include additional metadata about the forwarded messages, such as message objects, status, and any errors encountered.

Dependencies

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

Troubleshooting

Common Issues:

  • Invalid Chat ID or Message IDs: If the chat IDs or message IDs are incorrect or do not exist, the operation will fail.
  • Permission Errors: The bot/user must have permission to read messages in the source chat and send messages in the destination chat.
  • Session Expired/Unauthorized: If the Telegram session is closed or expired, you may see errors prompting you to log in again.

Error Messages:

  • "Session was closed or terminated. Please login again: https://telepilot.co/login-howto"
    Resolution: Re-authenticate your Telegram account using the provided guide.
  • "Please login: https://telepilot.co/login-howto"
    Resolution: Ensure your credentials are valid and the session is active.
  • Other errors may be passed through from the Telegram API, such as permission denied or invalid parameters.

Links and References


Discussion