Telegram MTProto Client icon

Telegram MTProto Client

Use Telegram Client API with MTProto protocol

Overview

This node enables sending messages and performing various chat-related operations on Telegram using the MTProto protocol. It is useful for automating interactions with Telegram chats, channels, and users directly from workflows. Common scenarios include sending text or media messages to specific chats, replying to messages, forwarding messages, managing chat members, retrieving message history, and creating new channels with invited users.

For the Send Message operation specifically, the node sends a plain text message to a specified chat or channel. This is beneficial for automated notifications, alerts, or any workflow that needs to communicate information via Telegram.

Example use cases:

  • Sending a notification message to a team chat when a task is completed.
  • Broadcasting updates to a Telegram channel.
  • Replying automatically to user queries in a support chat.

Properties

Name Meaning
Chat ID The target chat or channel identifier where the message will be sent. Can be a numeric ID or username (e.g., @username or -100xxxx). Required.
Message Text The text content of the message to send. Supports multiline input. Required.
Options Additional optional settings:
  Silent Boolean flag to send the message silently without triggering a notification. Default: false.
  Caption Caption text for media messages (not used in Send Message but available in other operations).
  Parse Mode How to parse the message text. Options: None, Markdown, HTML. Default: None.
  Limit Maximum number of items to return (not applicable for Send Message operation).

Output

The output JSON object for the Send Message operation includes:

  • success: Boolean indicating if the message was sent successfully (true).
  • messageId: Numeric ID of the sent message.
  • date: Timestamp of when the message was sent.
  • text: The exact text content that was sent.

Example output JSON:

{
  "success": true,
  "messageId": 12345,
  "date": "2024-06-01T12:34:56Z",
  "text": "Hello, this is a test message"
}

No binary data is output by this operation.

Dependencies

  • Requires an API authentication token with Telegram MTProto credentials including session string, API ID, and API hash.
  • Uses the Telegram MTProto client library internally to connect and perform actions.
  • The node must be configured with valid Telegram client credentials before use.

Troubleshooting

  • No credentials provided: The node will throw an error if the required Telegram API credentials are missing. Ensure you have set up and selected valid credentials.
  • Invalid Chat ID: If the chat ID or username is incorrect or inaccessible, the message sending will fail. Verify the chat/channel exists and your account has access.
  • Parse Mode errors: Using unsupported formatting in Markdown or HTML may cause message parsing errors. Use "None" if unsure.
  • Silent option not working: Some Telegram clients or chats may ignore silent flags depending on their settings.
  • Connection issues: Network problems or invalid API credentials can prevent connecting to Telegram servers.
  • Rate limits: Sending too many messages in a short time may trigger Telegram rate limits or restrictions.
  • Error messages: The node surfaces errors from Telegram API calls. Reading the error message helps identify issues like privacy restrictions or invalid parameters.

Links and References

Discussion