Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

The node "Telegram CoPilot" provides an interface to interact with Telegram via its API, enabling automation of various Telegram operations. Specifically for the Message resource and the Edit Message Text operation, this node allows users to edit the text content of an existing message in a specified chat.

This is useful in scenarios where you want to update or correct messages after they have been sent, such as fixing typos, updating information, or dynamically changing message content based on workflow logic.

Practical example:

  • Automatically correcting a previously sent notification message with updated data.
  • Editing bot-generated messages to reflect changes in status or results without sending new messages.

Properties

Name Meaning
Chat ID The unique identifier of the chat where the message to be edited exists.
Message ID The unique identifier of the message that you want to edit.
Message Text The new text content that will replace the current text of the specified message.

Output

The output is a JSON array containing the response from the Telegram API after attempting to edit the message text. This typically includes details about the edited message object, confirming the update.

No binary data output is involved in this operation.

Dependencies

  • Requires an active Telegram API authentication credential (an API key and associated login credentials).
  • Depends on the TelePilotNodeConnectionManager to manage Telegram client sessions.
  • The node requires a valid logged-in Telegram session; otherwise, it will throw errors prompting re-login.
  • Network access to Telegram's API endpoints is necessary.

Troubleshooting

  • Common issues:

    • Attempting to edit a message without a valid session will result in errors indicating the need to log in again.
    • Providing incorrect chat_id or message_id may cause the operation to fail because the message cannot be found.
    • Insufficient permissions to edit messages in certain chats (e.g., channels or groups where the bot/user lacks rights) can cause failures.
  • Error messages and resolutions:

    • "Session was closed or terminated. Please login again": The Telegram session has expired or been closed. Re-authenticate using the login procedure.
    • "Please login": No active Telegram session found. Use the login flow to establish a session before editing messages.
    • "Unauthorized": The provided credentials are invalid or expired. Renew credentials and log in again.
    • Errors related to invalid IDs usually mean the chat_id or message_id is incorrect or the message no longer exists.

Links and References

Discussion