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. 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.

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 notes 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 system might send voice messages in response to user queries.

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 Type of media to send; options: Photo, Video, Audio, Voice, Document
Options Additional settings including:
- Silent: Send message without notification
- Caption: Text caption for the media
- Parse Mode: How to parse captions/text; options: None, Markdown, HTML
- Limit: Maximum number of items to return (used in other operations, not directly 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, the output will contain an error message describing the issue.

Dependencies

  • Requires a valid Telegram Client API credential, which includes authentication details such as session string, 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 servers 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 that the API key, session, and related authentication data are correctly configured.
  • Unsupported operation: If an unsupported operation name is used, the node throws an error specifying the unsupported operation.
  • File path or URL issues: If the media file path or URL is incorrect or inaccessible, sending the media message will fail. Verify the file location and permissions.
  • Connection errors: Network issues or Telegram server problems may cause connection failures. Check internet connectivity and Telegram service status.
  • Parsing errors: Incorrect parse mode usage in captions may lead to formatting issues. Use supported parse modes (none, markdown, html).
  • Silent option confusion: If messages are sent silently but no notification is expected, confirm this behavior is intended.

To resolve errors, verify input parameters, ensure credentials are valid, and check network access.

Links and References

Discussion