Telegram JSON Inline Menu icon

Telegram JSON Inline Menu

Sends messages to Telegram

Overview

This node allows sending text messages or editing existing text messages in Telegram chats or channels. It is useful for automating communication workflows, such as sending notifications, alerts, or updates to Telegram users or groups. For example, you can use it to send a message to a specific chat when a new order is received or edit a previously sent message to update its content dynamically.

The "Send Message" operation sends a new text message to a specified chat or channel, optionally including an inline keyboard for interactive buttons. The "Edit Message Text" operation modifies the text of an existing message identified by chat and message IDs.

Properties

Name Meaning
Chat ID Unique identifier for the target chat or username of the target channel (e.g., @channelusername).
Text The text content of the message to be sent or edited.
Reply Markup Additional interface options for the message. Options: Inline Keyboard JSON (adds an inline keyboard), None.
Inline Keyboard JSON JSON structure defining an inline keyboard with buttons and links, used if "Reply Markup" is set to inline keyboard.
Additional Fields Collection of optional fields:
- Disable Notification Whether to send the message silently without sound notifications (only for sending messages).
- Disable WebPage Preview Whether to disable link previews for URLs in the message.
- Reply To Message ID If replying to a message, the ID of the original message (only for sending messages).
- Message Thread ID Identifier of the forum topic (only for sending messages).

Output

The node outputs an array of JSON objects representing the response from the Telegram API for each processed input item. Each output item contains the full JSON response data returned by Telegram after sending or editing a message.

If binary data is included (e.g., sending files), the node handles the binary stream accordingly, but this operation focuses on text messages and inline keyboards.

Dependencies

  • Requires a valid Telegram API authentication token configured in n8n credentials.
  • Uses Telegram Bot API endpoints sendMessage and editMessageText.
  • Supports sending additional parameters via "Additional Fields".
  • No external dependencies beyond the Telegram API and n8n's internal helper functions.

Troubleshooting

  • Missing or invalid Chat ID: Ensure the chat ID or channel username is correct and accessible by the bot.
  • File name missing for binary data: When sending binary data, a file name must be provided either in the binary property or manually in the node settings.
  • Invalid JSON in Inline Keyboard: The inline keyboard JSON must be well-formed; otherwise, the Telegram API will reject the request.
  • Permission errors: The bot must have permission to send messages or edit messages in the target chat or channel.
  • Error messages from Telegram API: These are passed through; check the error details for issues like message not found, chat not found, or rate limits.

To resolve errors, verify all required parameters, ensure proper bot permissions, and validate JSON structures.

Links and References

Discussion