Telegram GramJS icon

Telegram GramJS

Interact with Telegram using GramJS

Actions9

Message → Delete

AI-generated

Overview

This node allows users to delete a specific message in a Telegram chat using the GramJS library. It connects to the Telegram API with provided credentials and deletes the message identified by its ID from the specified chat. This operation is useful for managing chat content, such as removing outdated or incorrect messages.

Practical examples:

  • Automatically deleting a bot's previous notification message after an update.
  • Removing sensitive information sent by mistake in a group chat.
  • Cleaning up messages in a support chat after resolution.

Properties

Name Meaning
Message ID The unique identifier of the message to be deleted.
Additional Options Optional settings including:
• Parse Mode: How to parse the message text (None, Markdown, HTML).
• Silent: Whether to perform the deletion silently (true/false).

Note: For the Delete operation, only "Message ID" is required; "Additional Options" are available but may not affect deletion directly.

Output

The output JSON contains the result of the delete operation as returned by the Telegram client. Typically, this will be an object confirming the deletion status. The node does not output binary data for this operation.

Example output structure:

{
  "json": {
    // Confirmation or details about the deleted message(s)
  }
}

Dependencies

  • Requires a valid Telegram API connection using credentials that include API ID, API hash, and a session string.
  • Uses the GramJS Telegram client library to interact with Telegram.
  • No additional external services beyond Telegram are needed.

Troubleshooting

  • Authentication errors: If the node throws authentication errors, ensure the session string credential is valid and properly configured. Phone code or password authentication is not supported in this node.
  • Invalid Message ID: Deletion will fail if the message ID does not exist or the bot/user does not have permission to delete it.
  • Permission issues: The user/bot must have rights to delete messages in the target chat.
  • Unknown errors: The node wraps errors with a generic message; check the Telegram API limits and network connectivity.

Links and References

Discussion