Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

This node integrates with Telegram via the TelePilot API, enabling automation of various Telegram chat-related actions. Specifically, for the Chat resource and Delete Chat operation, it allows users to delete a specified chat by its ID. This is useful in scenarios where you want to programmatically remove chats from your Telegram account or bot context, such as cleaning up old or irrelevant conversations automatically.

Practical example: Automatically deleting a chat after processing its messages to keep your chat list tidy or to comply with data retention policies.

Properties

Name Meaning
Chat ID The unique identifier of the chat to be deleted. This is a required string input.

Output

The output is a JSON array containing the result of the delete chat operation. Typically, this will include confirmation or status information returned by the Telegram API about the deletion request.

Example structure (simplified):

[
  {
    "id": 123456789,
    "type": "...",
    "title": "...",
    "is_deleted": true,
    ...
  }
]

The exact fields depend on the Telegram API response but generally confirm that the chat was deleted.

No binary data output is produced by this operation.

Dependencies

  • Requires an active Telegram API authentication credential (an API key credential).
  • Depends on the TelePilotNodeConnectionManager to manage Telegram client sessions.
  • The node requires the user to be logged in to Telegram via the node’s login mechanism before performing chat operations.
  • Network access to Telegram servers is necessary.

Troubleshooting

  • Common issues:

    • Attempting to delete a chat without being logged in will cause errors.
    • Using an invalid or non-existent chat ID will likely result in an error or no action.
    • Session expiration or closure can cause the client to become unusable until re-login.
  • Error messages and resolutions:

    • "Session was closed or terminated. Please login again": Indicates the Telegram session has expired or been closed. Resolve by re-authenticating using the login flow.
    • "Please login": The node detected no active Telegram session. Use the login operation first.
    • "Unauthorized": The provided credentials are invalid or expired. Re-authenticate.

Ensure the chat ID is correct and that the Telegram account used has permission to delete the specified chat.

Links and References

Discussion