Actions12
Overview
The node provides integration with the Telegram Client API, enabling various messaging and chat management operations within Telegram. Specifically, the Delete Messages operation allows users to delete one or more messages from a specified chat or channel by message ID.
This node is beneficial in scenarios where automated cleanup of messages is required, such as removing outdated notifications, moderating content, or managing chat history programmatically. For example, a user can set up a workflow to delete specific messages after a certain event or time period, helping maintain chat relevance and privacy.
Properties
| Name | Meaning |
|---|---|
| Chat ID | The identifier or username of the chat/channel where the message exists (e.g., @username or -100xxxx). This specifies the target chat for deleting messages. |
| Message ID | The unique numeric ID of the message to be deleted within the specified chat. |
| Options | Not used in the Delete Messages operation; available options include Silent, Caption, Parse Mode, and Limit but are irrelevant here. |
Output
The output JSON object for the Delete Messages operation contains:
success: A boolean indicating whether the deletion was successful (true).deletedMessageId: The ID of the message that was deleted.
Example output:
{
"success": true,
"deletedMessageId": 12345
}
No binary data is output by this operation.
Dependencies
- Requires an active Telegram Client API credential, which includes authentication details such as session string, API ID, and API hash.
- The node uses the Telegram Client SDK internally to connect and perform actions.
- Network connectivity to Telegram servers is necessary.
- No additional environment variables or external services beyond Telegram API access are required.
Troubleshooting
Common Issues:
- Missing or invalid credentials will cause the node to throw an error indicating no credentials were provided.
- Incorrect
Chat IDorMessage IDmay result in failure to delete the message, possibly returning an error from the Telegram API. - Network issues or Telegram service downtime can cause connection failures.
Error Messages:
"No credentials provided": Ensure that valid Telegram Client API credentials are configured in n8n."Operation 'deleteMessages' is not supported": This would indicate an internal misconfiguration; verify the operation parameter is correctly set.- Errors related to message deletion typically come from Telegram API responses, e.g., "Message to delete not found" or "Insufficient rights". Check that the bot/user has permission to delete messages in the target chat.
Resolution Tips:
- Verify the correctness of
Chat IDandMessage ID. - Confirm that the authenticated user/bot has the necessary permissions to delete messages in the chat.
- Test connectivity to Telegram API outside n8n if persistent errors occur.
- Use the node's "Continue On Fail" option to handle errors gracefully in workflows.
- Verify the correctness of
Links and References
- Telegram Client API Documentation
- Telegram Bot API - Deleting Messages (for conceptual understanding; note this node uses the client API)
- n8n Documentation on Credentials