messages.ExportChatInvite

class pyrogram.raw.functions.messages.ExportChatInvite

Export an invite link for a chat

Details:
  • Layer: 227

  • 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_permanent → true (optional)
├── request_needed → true (optional)
├── peer → InputPeer
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_id → long
│ ├── InputPeerUser
│ │ ├── user_id → long
│ │ └── access_hash → long
│ ├── InputPeerChannel
│ │ ├── channel_id → long
│ │ └── access_hash → long
│ │ ├── peer → InputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_id → int
│ │ └── user_id → long
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── channel_id → long
├── expire_date → int (optional)
├── usage_limit → int (optional)
├── title → string (optional)
└── subscription_pricing → StarsSubscriptionPricing (optional)
├── period → int
└── amount → long

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
        ),
    )
)