Telegram MTProto Client icon

Telegram MTProto Client

Use Telegram Client API with MTProto protocol

Overview

This node operation creates a new Telegram channel or supergroup and invites specified users to it in a single step. It is useful for automating the setup of communication groups on Telegram, such as team channels, community groups, or announcement broadcast channels.

Typical use cases include:

  • Automatically creating a project or team channel and inviting team members.
  • Setting up a broadcast channel for announcements and adding initial subscribers.
  • Creating discussion supergroups with selected participants.

For example, you can create a "Marketing Team" supergroup and invite all marketing staff by providing their Telegram usernames, streamlining onboarding and communication setup.

Properties

Name Meaning
Channel Title The visible title of the channel or supergroup. This name appears in channel listings and to all members.
Channel Description A description shown in the channel info section to explain the channel's purpose.
Channel Type The type of channel to create:
Broadcast Channel: Only admins can post messages, ideal for announcements.
Supergroup: All members can post, suitable for discussions and communities.
Users to Invite Comma-separated list of Telegram usernames (each starting with @) to invite to the channel. Only usernames are supported, not user IDs. Leave empty to create the channel without inviting anyone.
Options Additional optional settings:
• Silent: Send messages silently without notification (not directly relevant here).
• Caption: Caption for media messages (not used here).
• Parse Mode: Text parsing mode (not used).
• Limit: Max items to return (not used).

Output

The output JSON object contains details about the created channel and invitation results:

  • success: Boolean indicating if the creation and invitation succeeded.
  • channelId: Unique identifier of the newly created channel/supergroup.
  • accessHash: Access hash for the channel (used internally by Telegram).
  • title: The channel title as set.
  • about: The channel description.
  • type: The channel type as a human-readable string ("Broadcast Channel" or "Supergroup").
  • link: A URL link to the created channel in the format https://t.me/c/{channelId}.
  • invitedUsers: Array of usernames successfully invited.
  • invitationStats: Object summarizing invitations:
    • total: Total number of usernames provided.
    • successful: Number of users successfully invited.
    • failed: Number of users who could not be invited.
  • createdAt: ISO timestamp of when the channel was created.

No binary data is output by this operation.

Dependencies

  • Requires an API authentication credential with Telegram MTProto API access, including session string, API ID, and API hash.
  • Uses the Telegram MTProto client library to interact with Telegram servers over WebSocket.
  • The executing environment must have network access to Telegram's API endpoints.

Troubleshooting

Common issues and error messages:

  • Invalid username format: If any username does not start with '@', the node throws an error specifying which usernames are invalid. Ensure all usernames begin with '@'.
  • CHANNELS_TOO_MUCH: Indicates the account has reached the maximum allowed number of channels or supergroups. Solution: leave some existing channels before creating new ones.
  • USER_RESTRICTED: Your Telegram account is restricted from creating new channels, possibly due to spam reports or terms violations.
  • CHAT_TITLE_EMPTY: The channel title was left empty. Provide a valid non-empty title.
  • CHAT_ABOUT_TOO_LONG: The channel description exceeds allowed length. Shorten the description.
  • USER_PRIVACY_RESTRICTED: Some users could not be invited because their privacy settings prevent being added to groups. They need to adjust their privacy settings to allow invitations.

If the node is configured to continue on failure, errors will be returned in the output JSON with success: false and an error message.

Links and References


This summary covers the "Create Channel and Invite" operation of the Telegram MTProto Client node based on static analysis of its source code and provided property definitions.

Discussion