Telematic icon

Telematic

Use Telegram Client API

Overview

This node integrates with the Telegram Client API to perform various messaging and chat management operations. Specifically, the Reply To Message operation allows users to send a reply to a specific message within a Telegram chat or channel. This is useful for maintaining context in conversations, such as responding directly to a question or comment in group chats or channels.

Practical examples include:

  • Automatically replying to user queries in a support chat.
  • Sending follow-up messages referencing a previous message in a discussion.
  • Creating bots that interact conversationally by replying to specific messages.

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 is directed.
Options Additional optional settings:
- Silent: Send the message without notification.
- Caption: Caption for media messages (not used in reply).
- Parse Mode: How to parse the message text; options are None, Markdown, or HTML.
- Limit: Maximum number of items to return (not applicable here).

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 snippet:

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

No binary data output is produced by this operation.

Dependencies

  • Requires an active Telegram API client session authenticated via API credentials (API ID and API Hash).
  • Needs a valid Telegram API key credential configured in n8n.
  • Uses WebSocket connection to Telegram servers with automatic retries on connection failures.

Troubleshooting

  • Missing or invalid credentials: The node throws an error if no credentials are provided or if the session string is missing/empty. Ensure that the Telegram API credentials are correctly set up in n8n.
  • Invalid Chat ID or Message ID: Errors may occur if the specified chat or message IDs do not exist or the bot/user does not have access. Verify the IDs and permissions.
  • Network or connection issues: Connection retries are implemented, but persistent network problems can cause failures. Check internet connectivity and Telegram server status.
  • Unsupported parse mode: If an unsupported parse mode is selected, the message might not format correctly. Use only None, Markdown, or HTML.
  • Error disconnecting client: Occasionally, errors during client disconnection are logged but do not affect execution. These can usually be ignored unless they persist.

If the node is set to continue on failure, errors for individual items will be returned in the output JSON with success: false and an error message describing the issue.

Links and References

Discussion