Telegram Client icon

Telegram Client

Use Telegram Client API

Overview

The node implements a Telegram client that interacts with the Telegram API to perform various messaging and chat management operations. Specifically, the Forward Message operation allows users to forward an existing message from one chat or channel to another chat or channel.

This node is beneficial in scenarios where automated workflows need to redistribute or share messages across different Telegram chats or channels without manually copying content. For example, a business could automatically forward customer support messages from a public channel to a private team chat for faster response, or aggregate important announcements by forwarding them to multiple groups.

Properties

Name Meaning
Chat ID The source chat or channel identifier or username (e.g., @username or -100xxxx) from which the message will be forwarded. Required.
Message ID The unique identifier of the message to forward within the source chat. Required.
To Chat ID The destination chat or channel identifier where the message will be forwarded. Required.
Options Additional optional settings:
- Silent: Send the forwarded message silently without notification (boolean).
- Caption: Caption text for media messages (string).
- Parse Mode: How to parse message text (none, markdown, or html).
- Limit: Maximum number of items to return (number, not applicable for forwarding).

Output

The output JSON object for the Forward Message operation includes:

  • success: Boolean indicating if the forwarding was successful.
  • originalMessageId: The ID of the original message that was forwarded.
  • forwardedMessages: An array containing details of the forwarded message(s) returned by the Telegram API.
  • fromChatId: The source chat ID from which the message was forwarded.
  • toChatId: The destination chat ID to which the message was forwarded.

This output provides confirmation and metadata about the forwarding action performed.

Dependencies

  • Requires valid Telegram API credentials including an API ID, API hash, and a session string.
  • The node uses the Telegram Client SDK internally to connect and interact with the Telegram API.
  • Network connectivity to Telegram servers is necessary.
  • Proper configuration of the Telegram API credentials in n8n is required before use.

Troubleshooting

  • No credentials provided: The node will throw an error if Telegram API credentials are missing or invalid. Ensure credentials are correctly set up in n8n.
  • Operation not supported: If an unsupported operation name is specified, the node throws an error. Verify the operation parameter is correct.
  • Message or chat not found: Forwarding may fail if the message ID or chat IDs are incorrect or inaccessible due to permissions.
  • Connection issues: Network problems or Telegram API downtime can cause connection failures. Check network and retry later.
  • Permission errors: Forwarding messages between certain chats or channels may require appropriate user permissions or bot rights.
  • Use the "Continue on Fail" option to handle errors gracefully in workflows.

Links and References

Discussion