messages.ExportChatInvite

class pyrogram.raw.functions.messages.ExportChatInvite

Export an invite link for a chat

Details:
  • Layer: 223

  • ID: A455DE90

Parameters:
  • peer (InputPeer) – Chat

  • legacy_revoke_permanent (bool, optional) – Legacy flag, reproducing legacy behavior of this method: if set, revokes all previous links before creating a new one. Kept for bot API BC, should not be used by modern clients.

  • request_needed (bool, optional) – Whether admin confirmation is required before admitting each separate user into the chat

  • expire_date (int 32-bit, optional) – Expiration date

  • usage_limit (int 32-bit, optional) – Maximum number of users that can join using this link

  • title (str, optional) – Description of the invite link, visible only to administrators

  • subscription_pricing (StarsSubscriptionPricing, optional) – For Telegram Star subscriptions », contains the pricing of the subscription the user must activate to join the private channel.

Returns:

ExportedChatInvite

TL Schema

messages.exportChatInvite#a455de90
flags:#
legacy_revoke_permanent:flags.2?true
request_needed:flags.3?true
peer:InputPeer
expire_date:flags.0?int
usage_limit:flags.1?int
title:flags.4?string
subscription_pricing:flags.5?StarsSubscriptionPricing

= ExportedChatInvite

Parameter Tree

ExportChatInvite
├── legacy_revoke_permanenttrue (optional)
├── request_neededtrue (optional)
├── peerInputPeer
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_idlong
│ ├── InputPeerUser
│ │ ├── user_idlong
│ │ └── access_hashlong
│ ├── InputPeerChannel
│ │ ├── channel_idlong
│ │ └── access_hashlong
│ │ ├── peerInputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_idint
│ │ └── user_idlong
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── channel_idlong
├── expire_dateint (optional)
├── usage_limitint (optional)
├── titlestring (optional)
└── subscription_pricingStarsSubscriptionPricing (optional)
├── periodint
└── amountlong

Example

await app.invoke(
    ExportChatInvite(
        legacy_revoke_permanent=None,
        request_needed=None,
        peer=await app.resolve_peer(chat_id),
        expire_date=0,
        usage_limit=0,
        title="text",
        subscription_pricing=StarsSubscriptionPricing(
            period=0,
            amount=0
        ),
    )
)