Rahsaz Telegram icon

Rahsaz Telegram

Sends data to Telegram

Overview

This node allows you to delete a specific chat message in Telegram. It is useful when you want to programmatically remove messages from a chat or channel, for example, to moderate content, clean up old messages, or retract sent information.

A practical scenario could be an automated moderation bot that deletes inappropriate messages based on certain triggers or filters. Another example is removing outdated announcements from a channel after a certain period.

Properties

Name Meaning
Chat ID Unique identifier for the target chat or username of the target channel (e.g., @channelusername). Specifies where the message to delete is located.
Message ID Unique identifier of the message to delete.

Output

The output contains a JSON object representing the result of the delete operation as returned by the Telegram API. Typically, this will be a boolean indicating success (true) or failure (false).

No binary data is output by this operation.

Example output JSON:

{
  "ok": true,
  "result": true
}

Dependencies

  • Requires an active Telegram Bot API key credential configured in n8n.
  • The node uses the Telegram Bot API endpoint deleteMessage.
  • No additional external services are required beyond Telegram.

Troubleshooting

  • Common issues:

    • Invalid chatId: Ensure the chat ID or channel username is correct and accessible by the bot.
    • Invalid messageId: The message ID must exist in the specified chat and be deletable by the bot.
    • Insufficient permissions: The bot must have rights to delete messages in the chat or channel.
  • Error messages:

    • "Bad Request: message to delete not found": The message ID does not exist or was already deleted.
    • "Bad Request: chat not found": The chat ID or username is incorrect or the bot is not a member.
    • "Forbidden: bot can't delete messages in a chat": The bot lacks permission to delete messages in the chat.

To resolve these errors, verify the chat and message IDs, ensure the bot is added to the chat with appropriate permissions, and confirm the bot token is valid.

Links and References

Discussion