Telegram Client icon

Telegram Client

Use Telegram Client API

Overview

This node integrates with the Telegram Client API to perform various messaging and chat management operations. Specifically, the "Delete Messages" operation allows users to delete one or more messages from a specified chat or channel by providing the chat identifier and message ID(s). This is useful for automating message cleanup, moderating chats, or managing content programmatically.

Practical examples include:

  • Automatically deleting outdated or sensitive messages in a group chat.
  • Removing specific messages after processing them in a workflow.
  • Moderation bots that clean up inappropriate content based on triggers.

Properties

Name Meaning
Chat ID The unique identifier or username of the chat/channel where the message exists (e.g., @username or -100xxxx). Required.
Message ID The numeric ID of the message to delete within the specified chat. Required.
Options Additional optional parameters (not used specifically in Delete Messages but available generally):
- Silent: Send message silently without notification.
- Caption: Caption for media messages.
- Parse Mode: How to parse message text (None, Markdown, HTML).
- Limit: Maximum number of items to return (used in other operations).

Output

The output JSON object for the "Delete Messages" operation contains:

  • success: Boolean indicating if the deletion was successful (true).
  • deletedMessageId: The ID of the message that was deleted.

Example output JSON:

{
  "success": true,
  "deletedMessageId": 12345
}

No binary data is output by this operation.

Dependencies

  • Requires an active Telegram Client API credential with valid session, API ID, and API hash.
  • The node uses the Telegram Client SDK internally to connect and perform operations.
  • Network connectivity to Telegram servers is required.
  • No additional environment variables are needed beyond the configured credentials.

Troubleshooting

  • No credentials provided: The node will throw an error if the Telegram Client API credentials are missing or invalid. Ensure credentials are properly set up in n8n.
  • Invalid Chat ID or Message ID: If the chat or message ID does not exist or the bot/user lacks permission, the deletion will fail. Verify IDs and permissions.
  • Connection issues: Network problems or Telegram server issues may cause connection failures. Check internet connectivity and retry.
  • Operation not supported: If an unsupported operation is selected, an error is thrown.
  • Continue on Fail: If enabled, errors during execution will be captured in the output JSON instead of stopping the workflow.

Links and References

Discussion