N8N Tools Telegram icon

N8N Tools Telegram

Interact with Telegram Bot API

Overview

The node "N8N Tools Telegram" enables interaction with the Telegram Bot API, allowing users to perform various operations related to Telegram messages, chats, bots, files, inline queries, callback queries, and updates. Specifically for the Messages resource and the Edit Message Text operation, this node allows editing the text content of an existing message in a Telegram chat.

This is useful in scenarios where you want to update or correct the content of a previously sent message without sending a new one. For example, you might want to fix a typo, update information dynamically, or change the message based on user interactions or external events.

Practical example:

  • A bot sends a status update message to a chat and later edits that message to reflect new status information.
  • Correcting or updating instructions sent earlier in a chat without cluttering the conversation with new messages.

Properties

Name Meaning
Chat ID The unique identifier for the target Telegram chat where the message exists.
Message ID The unique identifier of the message to be edited within the specified chat.
Message Data JSON object containing the new text and any additional parameters for editing the message.

Details on "Message Data"

  • This property expects a JSON string representing the data required by the Telegram API's editMessageText method.
  • It typically includes fields such as text (the new message text), parse_mode (e.g., Markdown or HTML formatting), and optional parameters like disable_web_page_preview.

Output

  • The output is a JSON object representing the response from the Telegram API after editing the message.
  • This usually contains the updated message object with details such as message ID, chat info, date, and the new text content.
  • The node does not output binary data for this operation.

Dependencies

  • Requires an active Telegram Bot API token configured as credentials in n8n.
  • Requires a valid subscription and API key for the "N8N Tools API" service, which validates usage before forwarding requests to Telegram.
  • The node uses HTTP requests to communicate with both the N8N Tools API and the Telegram Bot API endpoints.

Troubleshooting

  • Invalid subscription or API key error: If the node throws an error about invalid subscription or API key, verify that your API key credential for the N8N Tools API is correct and active.
  • Unknown operation error: Ensure the operation parameter is set exactly to "editMessageText" when editing message text.
  • Malformed JSON in Message Data: The messageData property must be a valid JSON string. Invalid JSON will cause parsing errors.
  • Message or Chat not found: If the specified chat ID or message ID does not exist or the bot lacks permission, the Telegram API will return an error.
  • Permission issues: The bot must have rights to edit messages in the target chat.

Links and References

Discussion