Telematic icon

Telematic

Use Telegram Client API

Overview

This node integrates with the Telegram Client API to perform various chat-related operations. Specifically, the "Send Media Message" operation allows users to send media files such as photos, videos, audio, voice messages, or documents to a specified Telegram chat or channel. This is useful for automating the distribution of multimedia content in Telegram groups, channels, or direct chats.

Practical examples include:

  • Sending promotional images or videos to a marketing channel.
  • Sharing recorded voice notes automatically to a support group.
  • Distributing documents or PDFs to team members via Telegram.

Properties

Name Meaning
Chat ID The target chat or channel identifier or username (e.g., @username or -100xxxx).
File Path Or URL The local path or URL of the media file to send.
Media Type The type of media being sent. Options: Photo, Video, Audio, Voice, Document.
Options Additional settings for the message:
- Silent Send the message without notification (boolean).
- Caption Text caption accompanying the media message (string).
- Parse Mode How to parse the caption text. Options: None, Markdown, HTML.
- Limit Maximum number of items to return (used in other operations, not relevant here).

Output

The output JSON object for the "Send Media Message" operation includes:

  • success: Boolean indicating if the message was sent successfully.
  • messageId: The unique identifier of the sent message.
  • date: Timestamp of when the message was sent.
  • mediaType: The type of media sent (photo, video, audio, voice, document).

If the operation fails and "continue on fail" is enabled, the output will contain an error message instead.

Dependencies

  • Requires an active Telegram client session authenticated with an API ID and API hash.
  • Needs credentials containing the Telegram API authentication details.
  • Uses the Telegram Client API library bundled as a dependency.
  • Requires network access to connect to Telegram servers using WebSocket Secure (WSS).

Troubleshooting

  • Missing Credentials: The node throws an error if no valid Telegram API credentials are provided. Ensure that the API ID, API hash, and session information are correctly configured.
  • Invalid Chat ID: If the chat ID or username is incorrect or inaccessible, sending the media message will fail.
  • File Not Found or Invalid URL: The file path or URL must be accessible and valid; otherwise, the upload will fail.
  • Unsupported Media Type: Only the specified media types (photo, video, audio, voice, document) are supported.
  • Connection Issues: Network problems or Telegram server issues may cause connection failures.
  • Error Messages: Errors thrown by the Telegram client are propagated. Enabling "continue on fail" allows processing subsequent items despite errors.

Links and References

Discussion