Contents Menu Expand Light mode Dark mode Auto light/dark mode
aiogram 3.1.1 documentation
Logo
aiogram 3.1.1 documentation
  • Installation
  • Migration FAQ (2.x -> 3.0)
  • Bot API
    • Bot
    • Client session
      • Use Custom API server
      • Base
      • aiohttp
      • Client session middlewares
    • Types
      • ChosenInlineResult
      • InlineQuery
      • InlineQueryResult
      • InlineQueryResultArticle
      • InlineQueryResultAudio
      • InlineQueryResultCachedAudio
      • InlineQueryResultCachedDocument
      • InlineQueryResultCachedGif
      • InlineQueryResultCachedMpeg4Gif
      • InlineQueryResultCachedPhoto
      • InlineQueryResultCachedSticker
      • InlineQueryResultCachedVideo
      • InlineQueryResultCachedVoice
      • InlineQueryResultContact
      • InlineQueryResultDocument
      • InlineQueryResultGame
      • InlineQueryResultGif
      • InlineQueryResultLocation
      • InlineQueryResultMpeg4Gif
      • InlineQueryResultPhoto
      • InlineQueryResultVenue
      • InlineQueryResultVideo
      • InlineQueryResultVoice
      • InlineQueryResultsButton
      • InputContactMessageContent
      • InputInvoiceMessageContent
      • InputLocationMessageContent
      • InputMessageContent
      • InputTextMessageContent
      • InputVenueMessageContent
      • SentWebAppMessage
      • 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
      • KeyboardButton
      • KeyboardButtonPollType
      • KeyboardButtonRequestChat
      • KeyboardButtonRequestUser
      • Location
      • LoginUrl
      • MenuButton
      • MenuButtonCommands
      • MenuButtonDefault
      • MenuButtonWebApp
      • Message
      • MessageAutoDeleteTimerChanged
      • MessageEntity
      • MessageId
      • PhotoSize
      • Poll
      • PollAnswer
      • PollOption
      • ProximityAlertTriggered
      • ReplyKeyboardMarkup
      • ReplyKeyboardRemove
      • ResponseParameters
      • Story
      • SwitchInlineQueryChosenChat
      • User
      • UserProfilePhotos
      • UserShared
      • Venue
      • Video
      • VideoChatEnded
      • VideoChatParticipantsInvited
      • VideoChatScheduled
      • VideoChatStarted
      • VideoNote
      • Voice
      • WebAppData
      • WebAppInfo
      • WriteAccessAllowed
      • EncryptedCredentials
      • EncryptedPassportElement
      • PassportData
      • PassportElementError
      • PassportElementErrorDataField
      • PassportElementErrorFile
      • PassportElementErrorFiles
      • PassportElementErrorFrontSide
      • PassportElementErrorReverseSide
      • PassportElementErrorSelfie
      • PassportElementErrorTranslationFile
      • PassportElementErrorTranslationFiles
      • PassportElementErrorUnspecified
      • PassportFile
      • Update
      • WebhookInfo
      • InputSticker
      • MaskPosition
      • Sticker
      • StickerSet
      • Invoice
      • LabeledPrice
      • OrderInfo
      • PreCheckoutQuery
      • ShippingAddress
      • ShippingOption
      • ShippingQuery
      • SuccessfulPayment
      • CallbackGame
      • Game
      • GameHighScore
    • Methods
      • answerCallbackQuery
      • approveChatJoinRequest
      • banChatMember
      • banChatSenderChat
      • close
      • closeForumTopic
      • closeGeneralForumTopic
      • copyMessage
      • createChatInviteLink
      • createForumTopic
      • declineChatJoinRequest
      • deleteChatPhoto
      • deleteChatStickerSet
      • deleteForumTopic
      • deleteMyCommands
      • editChatInviteLink
      • editForumTopic
      • editGeneralForumTopic
      • exportChatInviteLink
      • forwardMessage
      • getChat
      • getChatAdministrators
      • getChatMember
      • getChatMemberCount
      • getChatMenuButton
      • getFile
      • getForumTopicIconStickers
      • getMe
      • getMyCommands
      • getMyDefaultAdministratorRights
      • getMyDescription
      • getMyName
      • getMyShortDescription
      • getUserProfilePhotos
      • hideGeneralForumTopic
      • leaveChat
      • logOut
      • pinChatMessage
      • promoteChatMember
      • reopenForumTopic
      • reopenGeneralForumTopic
      • restrictChatMember
      • revokeChatInviteLink
      • sendAnimation
      • sendAudio
      • sendChatAction
      • sendContact
      • sendDice
      • sendDocument
      • sendLocation
      • sendMediaGroup
      • sendMessage
      • sendPhoto
      • sendPoll
      • sendVenue
      • sendVideo
      • sendVideoNote
      • sendVoice
      • setChatAdministratorCustomTitle
      • setChatDescription
      • setChatMenuButton
      • setChatPermissions
      • setChatPhoto
      • setChatStickerSet
      • setChatTitle
      • setMyCommands
      • setMyDefaultAdministratorRights
      • setMyDescription
      • setMyName
      • setMyShortDescription
      • unbanChatMember
      • unbanChatSenderChat
      • unhideGeneralForumTopic
      • unpinAllChatMessages
      • unpinAllForumTopicMessages
      • unpinAllGeneralForumTopicMessages
      • unpinChatMessage
      • answerPreCheckoutQuery
      • answerShippingQuery
      • createInvoiceLink
      • sendInvoice
      • addStickerToSet
      • createNewStickerSet
      • deleteStickerFromSet
      • deleteStickerSet
      • getCustomEmojiStickers
      • getStickerSet
      • sendSticker
      • setCustomEmojiStickerSetThumbnail
      • setStickerEmojiList
      • setStickerKeywords
      • setStickerMaskPosition
      • setStickerPositionInSet
      • setStickerSetThumbnail
      • setStickerSetTitle
      • uploadStickerFile
      • getGameHighScores
      • sendGame
      • setGameScore
      • deleteWebhook
      • getUpdates
      • getWebhookInfo
      • setWebhook
      • setPassportDataErrors
      • deleteMessage
      • editMessageCaption
      • editMessageLiveLocation
      • editMessageMedia
      • editMessageReplyMarkup
      • editMessageText
      • stopMessageLiveLocation
      • stopPoll
      • answerInlineQuery
      • answerWebAppQuery
    • Enums
      • BotCommandScopeType
      • ChatAction
      • ChatMemberStatus
      • ChatType
      • ContentType
      • Currency
      • DiceEmoji
      • EncryptedPassportElement
      • InlineQueryResultType
      • InputMediaType
      • MaskPositionPoint
      • MenuButtonType
      • MessageEntityType
      • ParseMode
      • PassportElementErrorType
      • PollType
      • StickerFormat
      • StickerType
      • TopicIconColor
      • UpdateType
    • How to download file?
    • How to upload file?
  • Handling events
    • Router
    • Dispatcher
    • Dependency injection
    • Filtering events
      • Command
      • ChatMemberUpdated
      • Magic filters
      • MagicData
      • Callback Data Factory & Filter
      • Exceptions
    • Long-polling
    • Webhook
    • Finite State Machine
      • Storages
    • Middlewares
    • Errors
    • Flags
    • Class based handlers
      • BaseHandler
      • CallbackQueryHandler
      • ChosenInlineResultHandler
      • ErrorHandler
      • InlineQueryHandler
      • MessageHandler
      • PollHandler
      • PreCheckoutQueryHandler
      • ShippingQueryHandler
      • ChatMemberHandler
  • Utils
    • Keyboard builder
    • Translation
    • Chat action sender
    • WebApp
    • Callback answer
    • Formatting
    • Media group builder
  • Changelog
  • Contributing
  v: latest
Versions
latest
stable
v3.1.1
v3.1.0
v3.0.0
v3.0.0rc1
v2.25.1
dev-3.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds
Back to top
Edit this page

exportChatInviteLink#

Returns: str

class aiogram.methods.export_chat_invite_link.ExportChatInviteLink(*, chat_id: int | str, **extra_data: Any)[source]#

Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.

Note: Each administrator in a chat generates their own invite links. Bots can’t use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using aiogram.methods.export_chat_invite_link.ExportChatInviteLink or by calling the aiogram.methods.get_chat.GetChat method. If your bot needs to generate a new primary invite link replacing its previous one, use aiogram.methods.export_chat_invite_link.ExportChatInviteLink again.

Source: https://core.telegram.org/bots/api#exportchatinvitelink

chat_id: int | str#

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

Usage#

As bot method#

result: str = await bot.export_chat_invite_link(...)

Method as object#

Imports:

  • from aiogram.methods.export_chat_invite_link import ExportChatInviteLink

  • alias: from aiogram.methods import ExportChatInviteLink

With specific bot#

result: str = await bot(ExportChatInviteLink(...))

As reply into Webhook in handler#

return ExportChatInviteLink(...)

As shortcut from received object#

  • aiogram.types.chat.Chat.export_invite_link()

Next
forwardMessage
Previous
editGeneralForumTopic
Copyright © 2023, aiogram Team
Made with Sphinx and @pradyunsg's Furo
On this page
  • exportChatInviteLink
    • ExportChatInviteLink
      • ExportChatInviteLink.chat_id
    • Usage
      • As bot method
      • Method as object
        • With specific bot
        • As reply into Webhook in handler
      • As shortcut from received object