Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

This node enables interaction with Telegram through the TelePilot API, acting as a personal assistant for managing Telegram chats and messages. Specifically, the "Delete Messages" operation under the "Message" resource allows users to delete one or more messages from a specified chat. It supports deleting messages either just for the user or for all participants in the chat.

Common scenarios where this node is beneficial include:

  • Automating cleanup of messages in group or private chats.
  • Removing sensitive or outdated messages programmatically.
  • Managing message history in bots or integrations that require message moderation.

Example: Automatically delete a batch of messages by their IDs from a specific chat after processing them.

Properties

Name Meaning
Chat ID The unique identifier of the chat from which messages will be deleted.
Message IDs Comma-separated list of message identifiers to delete.
Delete for All Users? Boolean flag indicating whether to delete the messages for everyone (true) or only locally (false).

Output

The output is a JSON array containing the response from the Telegram API after attempting to delete the specified messages. The exact structure depends on the Telegram API's response but generally includes confirmation of deletion or error details.

No binary data output is produced by this operation.

Dependencies

  • Requires an active Telegram API authentication credential (an API key and associated login).
  • Depends on the TelePilot Node Connection Manager to handle client sessions and API calls.
  • The node requires prior successful login via the Telegram account to perform operations.
  • Network access to Telegram servers is necessary.

Troubleshooting

  • Session Not Logged In: If the Telegram session is not logged in or has expired, errors like "Please login" or "Session was closed or terminated" may occur. Solution: Re-authenticate using the login flow described at https://telepilot.co/login-howto.
  • Unauthorized Errors: These indicate invalid or expired credentials. Re-login is required.
  • Invalid Chat or Message IDs: Providing incorrect chat or message IDs will cause the operation to fail. Verify IDs before use.
  • Deleting Messages for All Users: This requires appropriate permissions; if lacking, the operation might fail silently or return an error.
  • Malformed Message IDs: Ensure message IDs are comma-separated without extra spaces or invalid characters.

Links and References

Discussion