Telegram Client icon

Telegram Client

Use Telegram Client API

Overview

This node integrates with the Telegram Client API to perform various messaging and chat management operations on Telegram. Specifically, the "Send Media Message" operation allows users to send media files such as photos, videos, audio, voice notes, or documents to a specified chat or channel.

Common scenarios where this node is beneficial include:

  • Automating sending multimedia content to Telegram groups or channels.
  • Broadcasting updates with images or videos.
  • Sharing audio messages or documents programmatically.
  • Enhancing chatbot interactions by sending rich media.

For example, a marketing automation workflow could use this node to send promotional videos to a Telegram channel, or a customer support bot might send voice instructions to users.

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 silently without notification (true/false).
  Caption Caption text to accompany the media message.
  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: The timestamp when the message was sent.
  • mediaType: The type of media sent (photo, video, audio, voice, document).

If the operation succeeds, these fields confirm the message details. If it fails, an error message is returned instead.

Dependencies

  • Requires a valid Telegram Client API credential including session data, API ID, and API hash.
  • The node uses the Telegram Client SDK internally to connect and interact with Telegram servers.
  • Network connectivity to Telegram's API endpoints is necessary.
  • No additional environment variables are required beyond the provided credentials.

Troubleshooting

  • No credentials provided: The node will throw an error if the Telegram API credentials are missing or invalid. Ensure you have configured the required API authentication token properly.
  • File path or URL issues: If the media file path or URL is incorrect or inaccessible, sending the media will fail. Verify that the file exists and is reachable.
  • Unsupported media type: Only the specified media types (photo, video, audio, voice, document) are supported. Using unsupported types may cause errors.
  • Connection errors: Temporary network issues or Telegram server problems can cause connection failures. Retrying or checking network status may help.
  • Permission errors: Sending messages to certain chats or channels may require appropriate permissions. Make sure the authenticated user has rights to post in the target chat.

When errors occur, the node returns a JSON object with success: false and an error message describing the issue.

Links and References

Discussion