Telegram Client icon

Telegram Client

Use Telegram Client API

Overview

This node integrates with the Telegram Client API to perform various chat-related operations. Specifically, the Delete Messages operation allows users to delete one or more messages from a specified chat or channel by message ID. This is useful for managing chat content, removing outdated or incorrect messages, or moderating conversations.

Common scenarios include:

  • Automatically deleting bot-generated messages after a certain time.
  • Moderation workflows where inappropriate messages are removed.
  • Cleaning up chat history programmatically.

Example: Deleting a specific message in a group chat by providing the chat ID and the message ID to remove that message from the conversation.

Properties

Name Meaning
Chat ID The identifier of the chat or channel where the message exists. Can be a username (e.g., @username) or numeric ID (e.g., -100xxxx).
Message ID The unique numeric ID of the message to delete within the specified chat.
Options Additional optional parameters (not used specifically in Delete Messages but available generally):
- Silent: Send 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 (not applicable here).

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:

{
  "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 actions.
  • Network access to Telegram servers is required.
  • No additional environment variables beyond the API credentials are needed.

Troubleshooting

  • No credentials provided: The node will throw an error if the Telegram API credentials are missing or invalid. Ensure you have configured the required API authentication token properly.
  • Invalid Chat ID or Message ID: If the chat or message ID does not exist or the bot/user does not have permission, the deletion will fail. Verify IDs and permissions.
  • Operation not supported: If an unsupported operation is selected, an error is thrown.
  • Connection issues: Network problems or invalid session tokens can cause connection failures. Re-authenticate or check network connectivity.
  • Continue on Fail: If enabled, errors during execution will be captured in the output instead of stopping the workflow.

Links and References

Discussion