Telegram MTProto Client icon

Telegram MTProto Client

Use Telegram Client API with MTProto protocol

Overview

This node integrates with the Telegram MTProto Client API, enabling users to perform various Telegram chat operations programmatically. Specifically, the Send Media Message operation allows sending different types of media (photos, videos, audio, voice messages, or documents) to a specified Telegram chat or channel.

Common scenarios where this node is beneficial include:

  • Automating media sharing in Telegram groups or channels.
  • Broadcasting multimedia announcements or updates.
  • Sending user-generated content such as images or audio clips from other systems directly into Telegram chats.
  • Integrating Telegram media messaging into workflows for customer support, marketing, or community management.

For example, you could use this node to automatically send a promotional video to your Telegram channel whenever a new product launches or share daily photo updates in a group chat.

Properties

Name Meaning
Chat ID The target chat or channel identifier or username (e.g., @username or -100xxxx).
File Path Or URL The path or URL pointing to the media file to be sent.
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 (Not applicable for sending media but present in options collection; used in other operations.)

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, the output confirms the message details. If it fails, an error message will be returned (depending on error handling settings).

The node does not output binary data directly; it sends media files referenced by paths or URLs.

Dependencies

  • Requires valid Telegram API credentials including an API ID, API hash, and a session string for authentication.
  • Uses the Telegram MTProto protocol via the TelegramClient SDK.
  • Network access to Telegram servers is necessary.
  • No additional environment variables are required beyond the provided credentials.

Troubleshooting

Common Issues

  • Invalid Chat ID or Username: Ensure the chat ID or username is correct and accessible by the authenticated account.
  • File Not Found or Inaccessible: Verify that the file path or URL is valid and reachable.
  • Unsupported Media Type: Confirm the media type matches the file content and is one of the supported types.
  • Authentication Failure: Check that the API credentials and session are valid and have not expired.
  • Privacy Restrictions: Some users or groups may have privacy settings preventing messages or media from being sent.

Common Error Messages

  • "No credentials provided": Credentials must be configured before using the node.
  • Errors related to invalid usernames or chat IDs usually indicate incorrect input values.
  • Network or connection errors may occur if Telegram servers are unreachable.
  • If the node throws an error about unsupported operations, verify the selected operation matches the node's capabilities.

To resolve issues, double-check all inputs, ensure proper credential setup, and confirm network connectivity.

Links and References

Discussion