Contents Menu Expand Light mode Dark mode Auto light/dark mode
PTB has undergone significant changes in v20. Please read the documentation carefully and also check out the transition guide in the wiki.
python-telegram-bot
v20.3
Logo
python-telegram-bot
v20.3

Reference

  • telegram package
    • Bot
    • Available Types
      • Animation
      • Audio
      • BotCommand
      • BotCommandScope
      • BotCommandScopeAllChatAdministrators
      • BotCommandScopeAllGroupChats
      • BotCommandScopeAllPrivateChats
      • BotCommandScopeChat
      • BotCommandScopeChatAdministrators
      • BotCommandScopeChatMember
      • BotCommandScopeDefault
      • BotDescription
      • BotName
      • BotShortDescription
      • CallbackQuery
      • Chat
      • ChatAdministratorRights
      • ChatInviteLink
      • ChatJoinRequest
      • ChatLocation
      • ChatMember
      • ChatMemberAdministrator
      • ChatMemberBanned
      • ChatMemberLeft
      • ChatMemberMember
      • ChatMemberOwner
      • ChatMemberRestricted
      • ChatMemberUpdated
      • ChatPermissions
      • ChatPhoto
      • ChatShared
      • Contact
      • Dice
      • Document
      • File
      • ForceReply
      • ForumTopic
      • ForumTopicClosed
      • ForumTopicCreated
      • ForumTopicEdited
      • ForumTopicReopened
      • GeneralForumTopicHidden
      • GeneralForumTopicUnhidden
      • InlineKeyboardButton
      • InlineKeyboardMarkup
      • InputFile
      • InputMedia
      • InputMediaAnimation
      • InputMediaAudio
      • InputMediaDocument
      • InputMediaPhoto
      • InputMediaVideo
      • InputSticker
      • KeyboardButton
      • KeyboardButtonPollType
      • KeyboardButtonRequestChat
      • KeyboardButtonRequestUser
      • Location
      • LoginUrl
      • MenuButton
      • MenuButtonCommands
      • MenuButtonDefault
      • MenuButtonWebApp
      • Message
      • MessageAutoDeleteTimerChanged
      • MessageEntity
      • MessageId
      • PhotoSize
      • Poll
      • PollAnswer
      • PollOption
      • ProximityAlertTriggered
      • ReplyKeyboardMarkup
      • ReplyKeyboardRemove
      • SentWebAppMessage
      • SwitchInlineQueryChosenChat
      • TelegramObject
      • Update
      • User
      • UserProfilePhotos
      • UserShared
      • Venue
      • Video
      • VideoChatEnded
      • VideoChatParticipantsInvited
      • VideoChatScheduled
      • VideoChatStarted
      • VideoNote
      • Voice
      • WebAppData
      • WebAppInfo
      • WebhookInfo
      • WriteAccessAllowed
    • Stickers
      • 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
    • Payments
      • Invoice
      • LabeledPrice
      • OrderInfo
      • PreCheckoutQuery
      • ShippingAddress
      • ShippingOption
      • ShippingQuery
      • SuccessfulPayment
    • 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
    • CallbackContext
    • ContextTypes
    • Defaults
    • ExtBot
    • Job
    • JobQueue
    • Updater
    • Handlers
      • BaseHandler
      • CallbackQueryHandler
      • ChatJoinRequestHandler
      • ChatMemberHandler
      • ChosenInlineResultHandler
      • CommandHandler
      • ConversationHandler
      • filters Module
      • InlineQueryHandler
      • MessageHandler
      • 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
  v: stable
Versions
latest
stable
v20.3
v20.2
v20.1
v20.0
v20.0b0
v20.0a6
v20.0a5
v20.0a4
v20.0a3
v20.0a2
v20.0a1
v20.0a0
v13.15
v13.14
v13.13
v13.12
v13.11
v13.10
v13.9
v13.8.1
v13.8
v13.7
v13.6
v13.5
v13.4.1
v13.4
v13.3
v13.2
v13.1
v13.0
v12.8
v12.7
v12.6.1
v12.6
v12.5.1
v12.5
v12.4.2
v12.4.1
v12.4.0
v12.3.0
v12.2.0
v12.1.1
v12.1.0
v12.0.0
v12.0.0b1
doc-fixes
Downloads
pdf
On Read the Docs
Project Home
Builds
Back to top
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, *, 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.revoke_chat_invite_link()

Available In

  • telegram.ChatJoinRequest.invite_link

  • telegram.ChatMemberUpdated.invite_link

Returned In

  • telegram.Bot.create_chat_invite_link()

  • telegram.Bot.edit_chat_invite_link()

  • telegram.Bot.revoke_chat_invite_link()

New 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.

    New 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.

    New in version 13.8.

  • pending_join_request_count (int, optional) –

    Number of pending join requests created using this link.

    New in version 13.8.

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.

New 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.

New in version 13.8.

Type:

str

pending_join_request_count[source]¶

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

New in version 13.8.

Type:

int

classmethod de_json(data, bot)[source]¶

See telegram.TelegramObject.de_json().

Next
ChatJoinRequest
Previous
ChatAdministratorRights
Copyright © 2015-2023, 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.de_json()