Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
python-telegram-bot
v22.0
Logo
python-telegram-bot
v22.0

Reference

  • telegram package
    • Bot
    • Available Types
      • Animation
      • Audio
      • Birthdate
      • BotCommand
      • BotCommandScope
      • BotCommandScopeAllChatAdministrators
      • BotCommandScopeAllGroupChats
      • BotCommandScopeAllPrivateChats
      • BotCommandScopeChat
      • BotCommandScopeChatAdministrators
      • BotCommandScopeChatMember
      • BotCommandScopeDefault
      • BotDescription
      • BotName
      • BotShortDescription
      • BusinessConnection
      • BusinessIntro
      • BusinessLocation
      • BusinessOpeningHours
      • BusinessOpeningHoursInterval
      • BusinessMessagesDeleted
      • CallbackQuery
      • Chat
      • ChatAdministratorRights
      • ChatBackground
      • CopyTextButton
      • BackgroundType
      • BackgroundTypeFill
      • BackgroundTypeWallpaper
      • BackgroundTypePattern
      • BackgroundTypeChatTheme
      • BackgroundFill
      • BackgroundFillSolid
      • BackgroundFillGradient
      • BackgroundFillFreeformGradient
      • ChatBoost
      • ChatBoostAdded
      • ChatBoostRemoved
      • ChatBoostSource
      • ChatBoostSourceGiftCode
      • ChatBoostSourceGiveaway
      • ChatBoostSourcePremium
      • ChatBoostUpdated
      • ChatFullInfo
      • ChatInviteLink
      • ChatJoinRequest
      • ChatLocation
      • ChatMember
      • ChatMemberAdministrator
      • ChatMemberBanned
      • ChatMemberLeft
      • ChatMemberMember
      • ChatMemberOwner
      • ChatMemberRestricted
      • ChatMemberUpdated
      • ChatPermissions
      • ChatPhoto
      • ChatShared
      • Contact
      • Dice
      • Document
      • ExternalReplyInfo
      • File
      • ForceReply
      • ForumTopic
      • ForumTopicClosed
      • ForumTopicCreated
      • ForumTopicEdited
      • ForumTopicReopened
      • GeneralForumTopicHidden
      • GeneralForumTopicUnhidden
      • Giveaway
      • GiveawayCompleted
      • GiveawayCreated
      • GiveawayWinners
      • InaccessibleMessage
      • InlineKeyboardButton
      • InlineKeyboardMarkup
      • InputFile
      • InputMedia
      • InputMediaAnimation
      • InputMediaAudio
      • InputMediaDocument
      • InputMediaPhoto
      • InputMediaVideo
      • InputPaidMedia
      • InputPaidMediaPhoto
      • InputPaidMediaVideo
      • InputPollOption
      • KeyboardButton
      • KeyboardButtonPollType
      • KeyboardButtonRequestChat
      • KeyboardButtonRequestUsers
      • LinkPreviewOptions
      • Location
      • LoginUrl
      • MaybeInaccessibleMessage
      • MenuButton
      • MenuButtonCommands
      • MenuButtonDefault
      • MenuButtonWebApp
      • Message
      • MessageAutoDeleteTimerChanged
      • MessageEntity
      • MessageId
      • MessageOrigin
      • MessageOriginChannel
      • MessageOriginChat
      • MessageOriginHiddenUser
      • MessageOriginUser
      • MessageReactionCountUpdated
      • MessageReactionUpdated
      • PaidMedia
      • PaidMediaInfo
      • PaidMediaPhoto
      • PaidMediaPreview
      • PaidMediaPurchased
      • PaidMediaVideo
      • PhotoSize
      • Poll
      • PollAnswer
      • PollOption
      • ProximityAlertTriggered
      • ReactionCount
      • ReactionType
      • ReactionTypeCustomEmoji
      • ReactionTypeEmoji
      • ReactionTypePaid
      • ReplyKeyboardMarkup
      • ReplyKeyboardRemove
      • ReplyParameters
      • SentWebAppMessage
      • SharedUser
      • Story
      • SwitchInlineQueryChosenChat
      • TelegramObject
      • TextQuote
      • Update
      • User
      • UserChatBoosts
      • UserProfilePhotos
      • UsersShared
      • Venue
      • Video
      • VideoChatEnded
      • VideoChatParticipantsInvited
      • VideoChatScheduled
      • VideoChatStarted
      • VideoNote
      • Voice
      • WebAppData
      • WebAppInfo
      • WebhookInfo
      • WriteAccessAllowed
    • Stickers
      • Gift
      • Gifts
      • InputSticker
      • MaskPosition
      • Sticker
      • StickerSet
    • Inline Mode
      • ChosenInlineResult
      • InlineQuery
      • InlineQueryResult
      • InlineQueryResultArticle
      • InlineQueryResultAudio
      • InlineQueryResultCachedAudio
      • InlineQueryResultCachedDocument
      • InlineQueryResultCachedGif
      • InlineQueryResultCachedMpeg4Gif
      • InlineQueryResultCachedPhoto
      • InlineQueryResultCachedSticker
      • InlineQueryResultCachedVideo
      • InlineQueryResultCachedVoice
      • InlineQueryResultContact
      • InlineQueryResultDocument
      • InlineQueryResultGame
      • InlineQueryResultGif
      • InlineQueryResultLocation
      • InlineQueryResultMpeg4Gif
      • InlineQueryResultPhoto
      • InlineQueryResultsButton
      • InlineQueryResultVenue
      • InlineQueryResultVideo
      • InlineQueryResultVoice
      • InputMessageContent
      • InputTextMessageContent
      • InputLocationMessageContent
      • InputVenueMessageContent
      • InputContactMessageContent
      • InputInvoiceMessageContent
      • PreparedInlineMessage
    • Payments
      • AffiliateInfo
      • Invoice
      • LabeledPrice
      • OrderInfo
      • PreCheckoutQuery
      • RefundedPayment
      • RevenueWithdrawalState
      • RevenueWithdrawalStateFailed
      • RevenueWithdrawalStatePending
      • RevenueWithdrawalStateSucceeded
      • ShippingAddress
      • ShippingOption
      • ShippingQuery
      • StarTransaction
      • StarTransactions
      • SuccessfulPayment
      • TransactionPartner
      • TransactionPartnerAffiliateProgram
      • TransactionPartnerChat
      • TransactionPartnerFragment
      • TransactionPartnerOther
      • TransactionPartnerTelegramAds
      • TransactionPartnerTelegramApi
      • TransactionPartnerUser
    • Games
      • Callbackgame
      • Game
      • GameHighScore
    • Passport
      • Credentials
      • DataCredentials
      • EncryptedCredentials
      • EncryptedPassportElement
      • FileCredentials
      • IdDocumentData
      • PassportData
      • PassportElementError
      • PassportElementErrorDataField
      • PassportElementErrorFile
      • PassportElementErrorFiles
      • PassportElementErrorFrontSide
      • PassportElementErrorReverseSide
      • PassportElementErrorSelfie
      • PassportElementErrorTranslationFile
      • PassportElementErrorTranslationFiles
      • PassportElementErrorUnspecified
      • PassportFile
      • PersonalDetails
      • ResidentialAddress
      • SecureData
      • SecureValue
  • telegram.ext package
    • Application
    • ApplicationBuilder
    • ApplicationHandlerStop
    • BaseUpdateProcessor
    • CallbackContext
    • ContextTypes
    • Defaults
    • ExtBot
    • Job
    • JobQueue
    • SimpleUpdateProcessor
    • Updater
    • Handlers
      • BaseHandler
      • BusinessConnectionHandler
      • BusinessMessagesDeletedHandler
      • CallbackQueryHandler
      • ChatBoostHandler
      • ChatJoinRequestHandler
      • ChatMemberHandler
      • ChosenInlineResultHandler
      • CommandHandler
      • ConversationHandler
      • filters Module
      • InlineQueryHandler
      • MessageHandler
      • MessageReactionHandler
      • PaidMediaPurchasedHandler
      • PollAnswerHandler
      • PollHandler
      • PreCheckoutQueryHandler
      • PrefixHandler
      • ShippingQueryHandler
      • StringCommandHandler
      • StringRegexHandler
      • TypeHandler
    • Persistence
      • BasePersistence
      • DictPersistence
      • PersistenceInput
      • PicklePersistence
    • Arbitrary Callback Data
      • CallbackDataCache
      • InvalidCallbackData
    • Rate Limiting
      • BaseRateLimiter
      • AIORateLimiter
  • Auxiliary modules
    • telegram.constants Module
    • telegram.error Module
    • telegram.helpers Module
    • telegram.request Module
      • BaseRequest
      • RequestData
      • HTTPXRequest
    • telegram.warnings Module
  • Telegrams Bot API Docs

Resources

  • Examples
    • arbitrarycallbackdatabot.py
    • chatmemberbot.py
    • contexttypesbot.py
    • conversationbot.py
    • conversationbot2.py
    • customwebhookbot.py
    • deeplinking.py
    • echobot.py
    • errorhandlerbot.py
    • inlinebot.py
    • inlinekeyboard.py
    • inlinekeyboard2.py
    • nestedconversationbot.py
    • passportbot.py
    • paymentbot.py
    • persistentconversationbot.py
    • pollbot.py
    • rawapibot.py
    • timerbot.py
    • webappbot.py
  • Wiki

Project

  • Stability Policy
  • Changelog
  • Contributor Covenant Code of Conduct
  • How To Contribute
  • Testing in PTB
  • Website
  • GitHub Repository
  • Telegram Channel
  • Telegram User Group
Back to top
View this page
Edit this page

ChatInviteLink¶

class telegram.ChatInviteLink(invite_link, creator, creates_join_request, is_primary, is_revoked, expire_date=None, member_limit=None, name=None, pending_join_request_count=None, subscription_period=None, subscription_price=None, *, api_kwargs=None)[source]¶

Bases: telegram.TelegramObject

This object represents an invite link for a chat.

Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their invite_link, creator, creates_join_request, is_primary and is_revoked are equal.

Use In

  • telegram.Bot.edit_chat_invite_link()

  • telegram.Bot.edit_chat_subscription_invite_link()

  • telegram.Bot.revoke_chat_invite_link()

Available In

  • telegram.ChatJoinRequest.invite_link

  • telegram.ChatMemberUpdated.invite_link

Returned In

  • telegram.Bot.create_chat_invite_link()

  • telegram.Bot.create_chat_subscription_invite_link()

  • telegram.Bot.edit_chat_invite_link()

  • telegram.Bot.edit_chat_subscription_invite_link()

  • telegram.Bot.revoke_chat_invite_link()

Added in version 13.4.

Changed in version 20.0:

  • The argument & attribute creates_join_request is now required to comply with the Bot API.

  • Comparing objects of this class now also takes creates_join_request into account.

Parameters:
  • invite_link (str) – The invite link.

  • creator (telegram.User) – Creator of the link.

  • creates_join_request (bool) –

    True, if users joining the chat via the link need to be approved by chat administrators.

    Added in version 13.8.

  • is_primary (bool) – True, if the link is primary.

  • is_revoked (bool) – True, if the link is revoked.

  • expire_date (datetime.datetime, optional) –

    Date when the link will expire or has been expired.

    Changed in version 20.3: The default timezone of the bot is used for localization, which is UTC unless telegram.ext.Defaults.tzinfo is used.

  • member_limit (int, optional) – Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1- 99999.

  • name (str, optional) –

    Invite link name. 0-32 characters.

    Added in version 13.8.

  • pending_join_request_count (int, optional) –

    Number of pending join requests created using this link.

    Added in version 13.8.

  • subscription_period (int, optional) –

    The number of seconds the subscription will be active for before the next payment.

    Added in version 21.5.

  • subscription_price (int, optional) –

    The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat using the link.

    Added in version 21.5.

invite_link[source]¶

The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with '…'.

Type:

str

creator[source]¶

Creator of the link.

Type:

telegram.User

creates_join_request[source]¶

True, if users joining the chat via the link need to be approved by chat administrators.

Added in version 13.8.

Type:

bool

is_primary[source]¶

True, if the link is primary.

Type:

bool

is_revoked[source]¶

True, if the link is revoked.

Type:

bool

expire_date[source]¶

Optional. Date when the link will expire or has been expired.

Changed in version 20.3: The default timezone of the bot is used for localization, which is UTC unless telegram.ext.Defaults.tzinfo is used.

Type:

datetime.datetime

member_limit[source]¶

Optional. Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1- 99999.

Type:

int

name[source]¶

Optional. Invite link name. 0-32 characters.

Added in version 13.8.

Type:

str

pending_join_request_count[source]¶

Optional. Number of pending join requests created using this link.

Added in version 13.8.

Type:

int

subscription_period[source]¶

Optional. The number of seconds the subscription will be active for before the next payment.

Added in version 21.5.

Type:

int

subscription_price[source]¶

Optional. The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat using the link.

Added in version 21.5.

Type:

int

classmethod de_json(data, bot=None)[source]¶

See telegram.TelegramObject.de_json().

Next
ChatJoinRequest
Previous
ChatFullInfo
Copyright © 2015-2025, Leandro Toledo
Made with Sphinx and @pradyunsg's Furo
On this page
  • ChatInviteLink
    • ChatInviteLink
      • ChatInviteLink.invite_link
      • ChatInviteLink.creator
      • ChatInviteLink.creates_join_request
      • ChatInviteLink.is_primary
      • ChatInviteLink.is_revoked
      • ChatInviteLink.expire_date
      • ChatInviteLink.member_limit
      • ChatInviteLink.name
      • ChatInviteLink.pending_join_request_count
      • ChatInviteLink.subscription_period
      • ChatInviteLink.subscription_price
      • ChatInviteLink.de_json()