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 operations. Specifically, for the Reply To Message operation, it allows sending a reply message to a specific existing message in a chat or channel.

This is useful when you want to automate conversations on Telegram by replying directly to messages, maintaining context and threading in chats. For example, a bot could automatically respond to user queries by replying to their messages, or a workflow could acknowledge receipt of information by replying to a particular message.

Properties

Name Meaning
Chat ID The identifier of the chat or channel where the reply will be sent. Can be an ID or username (e.g., @username or -100xxxx).
Message Text The text content of the reply message to send.
Message ID The ID of the message to which this reply should be attached.
Options Additional optional settings:
- Silent Boolean flag to send the message silently without notification.
- Caption Caption text for media messages (not applicable here but part of options).
- Parse Mode How to parse the message text; options are None, Markdown, or HTML.
- Limit Maximum number of items to return (not relevant for reply operation but present in options).

Output

The output JSON object for the Reply To Message operation includes:

  • success: Boolean indicating if the reply was sent successfully.
  • messageId: The unique ID of the newly sent reply message.
  • replyToMessageId: The ID of the original message being replied to.
  • date: Timestamp of when the reply message was sent.
  • text: The text content of the reply message.

Example output JSON:

{
  "success": true,
  "messageId": 12345,
  "replyToMessageId": 67890,
  "date": "2024-06-01T12:34:56Z",
  "text": "Your reply message text"
}

Dependencies

  • Requires valid Telegram API credentials including session string, API ID, and API hash.
  • Uses the Telegram Client SDK internally to connect and interact with Telegram's API.
  • Needs n8n credentials configured with these Telegram API details.
  • Network connectivity to Telegram servers is required.

Troubleshooting

  • No credentials provided: The node will throw an error if Telegram API credentials are missing or invalid. Ensure credentials are properly set up in n8n.
  • Operation not supported: If an unsupported operation name is used, an error will be thrown.
  • Connection issues: Network problems or invalid API keys can cause connection failures.
  • Message ID errors: Providing an incorrect or non-existent message ID for replying may result in failure.
  • Parse mode issues: Using unsupported parse modes or malformed markdown/html can cause message sending errors.

To resolve errors:

  • Verify Telegram API credentials and permissions.
  • Confirm the chat ID and message ID exist and are accessible.
  • Check network connectivity.
  • Use correct parse mode values (none, markdown, html).

Links and References

Discussion