create_chat_subscription_invite_link()¶
- async Client.create_chat_subscription_invite_link()¶
Create a subscription invite link for a channel chat.
The bot must be an administrator in the channel and have the
can_invite_usersadmin right. Returns the new invite link as aChatInviteLinkobject.Usable by Users Bots- Parameters:
chat_id (
int|str) – Unique identifier (int) or username (str) of the target channel.subscription_period (
int) – The number of seconds the subscription is active for before the next payment. Currently, must always be 2592000 (30 days).subscription_price (
int) – The number of Telegram Stars a user must pay to join the channel for onesubscription_period. Must be between 1 and 10000.name (
str, optional) – Invite link name; 0-32 characters.
- Returns:
ChatInviteLink– On success, the new invite link is returned.
Example
# Create a monthly subscription link for 50 Stars link = await app.create_chat_subscription_invite_link( chat_id=chat_id, subscription_period=2592000, subscription_price=50, name="Monthly subscribers", )