Telegram Client icon

Telegram Client

Use Telegram Client API

Overview

The node implements a Telegram client that interacts with the Telegram API to perform various messaging operations. Specifically, for the Send File operation, it allows sending any type of file to a specified chat or channel on Telegram. This is useful for automating file sharing in chats, such as sending documents, images, or other media files programmatically.

Common scenarios include:

  • Automatically sending reports or logs as files to a team chat.
  • Sharing media or documents with users or channels without manual intervention.
  • Integrating Telegram file sending into workflows that generate or collect files dynamically.

Example: Sending a PDF report file to a project group chat whenever a new report is generated.

Properties

Name Meaning
Chat ID The target chat or channel identifier where the file will be sent. Can be an ID or username (e.g., @username or -100xxxx).
File Path Or URL The local path or a URL pointing to the file to send.
Options Additional optional settings:
• Silent: Send without notification (true/false)
• Caption: Text caption for the file
• Parse Mode: How to parse the caption text — None, Markdown, or HTML
• Limit: Maximum number of items to return (not applicable for sendFile but part of options collection)

Output

The output JSON object for the Send File operation includes:

  • success: Boolean indicating if the file was sent successfully.
  • messageId: The unique identifier of the sent message containing the file.
  • date: Timestamp of when the message was sent.
  • filePath: The original file path or URL used to send the file.

If the operation fails and "Continue On Fail" is enabled, the output will contain:

  • success: false
  • error: Error message describing what went wrong.
  • operation: The operation name ("sendFile").

The node does not output binary data directly; it only confirms the sending status and metadata about the sent message.

Dependencies

  • Requires a valid Telegram API authentication credential consisting of a session string, API ID, and API hash.
  • Uses the Telegram Client SDK internally to connect and interact with the Telegram API.
  • Needs network access to Telegram servers.
  • No additional environment variables are required beyond the provided credentials.

Troubleshooting

  • No credentials provided: The node throws an error if the Telegram API credentials are missing or invalid. Ensure you have configured the required API authentication token correctly.
  • File not found or inaccessible: If the file path or URL is incorrect or unreachable, the send operation will fail. Verify the file location and permissions.
  • Invalid Chat ID: Using an incorrect or unauthorized chat/channel ID will cause errors. Confirm the chat ID or username is correct and accessible by the authenticated user.
  • Network issues: Connection failures to Telegram servers can cause timeouts or errors. Check your internet connection and firewall settings.
  • Unsupported file types or size limits: Telegram imposes limits on file sizes and types. Large files or unsupported formats may be rejected.
  • Error disconnecting client: Occasionally, disconnection errors are logged but do not affect the main operation. These can usually be ignored unless persistent.

Links and References

Discussion