Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

The node "Telegram CoPilot" integrates with the Telegram API to perform various Telegram-related actions programmatically. Specifically, for the Chat resource and Send Chat Action operation, it allows sending chat action notifications to a specified chat. These chat actions indicate to the chat participants that the user is performing an activity such as typing, recording a voice note, or uploading media.

This node is beneficial in scenarios where you want to simulate real-time user activity indicators in Telegram chats via automation workflows. For example, when building a chatbot or automated messaging system, sending chat actions like "typing" or "uploading photo" can improve user experience by showing that the bot is actively processing or preparing a message.

Practical examples:

  • Indicate "typing" status before sending a message.
  • Show "uploading photo" while an image is being sent.
  • Cancel any ongoing chat action if the process is aborted.

Properties

Name Meaning
Chat ID The unique identifier of the Telegram chat where the chat action will be sent.
Action The type of chat action to send. Options include:
- Cancel
- Recording voice note
- Typing
- Uploading document
- Uploading photo
- Uploading video
- Uploading voice note

Output

The output is a JSON array containing the response from the Telegram API after invoking the sendChatAction method. This typically includes confirmation of the action sent or error details if the request failed.

Example output structure (simplified):

[
  {
    "_": "ok",
    "action": {
      "_": "chatActionTyping"
    },
    "chat_id": 123456789
  }
]

If the action is successful, the output confirms the chat ID and the action performed. If there is an error, the output will contain error information describing what went wrong.

The node does not output binary data for this operation.

Dependencies

  • Requires an active Telegram API authentication credential (an API key credential with necessary permissions).
  • Depends on the TelePilot Node Connection Manager to manage Telegram client sessions.
  • Requires proper login/authentication to Telegram via phone number and code before performing chat actions.
  • No additional external services are required beyond Telegram's API.

Troubleshooting

  • Common issues:

    • Not logged in: The node requires a valid Telegram session. If not logged in, it will throw an error prompting to login using the login flow.
    • Invalid chat ID: Providing an incorrect or non-existent chat ID will cause the API call to fail.
    • Permission errors: If the bot/user does not have permission to send chat actions in the target chat, the request will be rejected.
  • Error messages and resolutions:

    • "Please login": Indicates the Telegram session is not authenticated. Resolve by running the login operation first.
    • "Unauthorized": The API credentials are invalid or expired. Re-authenticate.
    • "A closed client cannot be reused": The Telegram client session was closed unexpectedly. Restart the session/login.
    • Other Telegram API errors will be passed through; check the error message for specifics (e.g., chat write forbidden).

Links and References

Discussion