Contents Menu Expand Light mode Dark mode Auto light/dark mode
aiogram 3.0.0b7 documentation
Logo
aiogram 3.0.0b7 documentation
  • Installation
  • Bot API
    • Bot
    • Client session
      • Use Custom API server
      • Base
      • aiohttp
    • Types
      • ChosenInlineResult
      • InlineQuery
      • InlineQueryResult
      • InlineQueryResultArticle
      • InlineQueryResultAudio
      • InlineQueryResultCachedAudio
      • InlineQueryResultCachedDocument
      • InlineQueryResultCachedGif
      • InlineQueryResultCachedMpeg4Gif
      • InlineQueryResultCachedPhoto
      • InlineQueryResultCachedSticker
      • InlineQueryResultCachedVideo
      • InlineQueryResultCachedVoice
      • InlineQueryResultContact
      • InlineQueryResultDocument
      • InlineQueryResultGame
      • InlineQueryResultGif
      • InlineQueryResultLocation
      • InlineQueryResultMpeg4Gif
      • InlineQueryResultPhoto
      • InlineQueryResultVenue
      • InlineQueryResultVideo
      • InlineQueryResultVoice
      • InputContactMessageContent
      • InputInvoiceMessageContent
      • InputLocationMessageContent
      • InputMessageContent
      • InputTextMessageContent
      • InputVenueMessageContent
      • SentWebAppMessage
      • Animation
      • Audio
      • BotCommand
      • BotCommandScope
      • BotCommandScopeAllChatAdministrators
      • BotCommandScopeAllGroupChats
      • BotCommandScopeAllPrivateChats
      • BotCommandScopeChat
      • BotCommandScopeChatAdministrators
      • BotCommandScopeChatMember
      • BotCommandScopeDefault
      • CallbackQuery
      • Chat
      • ChatAdministratorRights
      • ChatInviteLink
      • ChatJoinRequest
      • ChatLocation
      • ChatMember
      • ChatMemberAdministrator
      • ChatMemberBanned
      • ChatMemberLeft
      • ChatMemberMember
      • ChatMemberOwner
      • ChatMemberRestricted
      • ChatMemberUpdated
      • ChatPermissions
      • ChatPhoto
      • Contact
      • Dice
      • Document
      • File
      • ForceReply
      • ForumTopic
      • ForumTopicClosed
      • ForumTopicCreated
      • ForumTopicEdited
      • ForumTopicReopened
      • GeneralForumTopicHidden
      • GeneralForumTopicUnhidden
      • InlineKeyboardButton
      • InlineKeyboardMarkup
      • InputFile
      • InputMedia
      • InputMediaAnimation
      • InputMediaAudio
      • InputMediaDocument
      • InputMediaPhoto
      • InputMediaVideo
      • KeyboardButton
      • KeyboardButtonPollType
      • Location
      • LoginUrl
      • MenuButton
      • MenuButtonCommands
      • MenuButtonDefault
      • MenuButtonWebApp
      • Message
      • MessageAutoDeleteTimerChanged
      • MessageEntity
      • MessageId
      • PhotoSize
      • Poll
      • PollAnswer
      • PollOption
      • ProximityAlertTriggered
      • ReplyKeyboardMarkup
      • ReplyKeyboardRemove
      • ResponseParameters
      • User
      • UserProfilePhotos
      • 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
      • MaskPosition
      • Sticker
      • StickerSet
      • Invoice
      • LabeledPrice
      • OrderInfo
      • PreCheckoutQuery
      • ShippingAddress
      • ShippingOption
      • ShippingQuery
      • SuccessfulPayment
      • CallbackGame
      • Game
      • GameHighScore
      • ErrorEvent
    • Methods
      • answerCallbackQuery
      • approveChatJoinRequest
      • banChatMember
      • banChatSenderChat
      • close
      • closeForumTopic
      • closeGeneralForumTopic
      • copyMessage
      • createChatInviteLink
      • createForumTopic
      • declineChatJoinRequest
      • deleteChatPhoto
      • deleteChatStickerSet
      • deleteForumTopic
      • deleteMyCommands
      • editChatInviteLink
      • editForumTopic
      • editGeneralForumTopic
      • editMessageLiveLocation
      • exportChatInviteLink
      • forwardMessage
      • getChat
      • getChatAdministrators
      • getChatMember
      • getChatMemberCount
      • getChatMenuButton
      • getFile
      • getForumTopicIconStickers
      • getMe
      • getMyCommands
      • getMyDefaultAdministratorRights
      • 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
      • stopMessageLiveLocation
      • unbanChatMember
      • unbanChatSenderChat
      • unhideGeneralForumTopic
      • unpinAllChatMessages
      • unpinAllForumTopicMessages
      • unpinChatMessage
      • answerPreCheckoutQuery
      • answerShippingQuery
      • createInvoiceLink
      • sendInvoice
      • addStickerToSet
      • createNewStickerSet
      • deleteStickerFromSet
      • getCustomEmojiStickers
      • getStickerSet
      • sendSticker
      • setStickerPositionInSet
      • setStickerSetThumb
      • uploadStickerFile
      • getGameHighScores
      • sendGame
      • setGameScore
      • deleteWebhook
      • getUpdates
      • getWebhookInfo
      • setWebhook
      • setPassportDataErrors
      • deleteMessage
      • editMessageCaption
      • editMessageMedia
      • editMessageReplyMarkup
      • editMessageText
      • stopPoll
      • answerInlineQuery
      • answerWebAppQuery
    • Enums
      • BotCommandScopeType
      • ChatAction
      • ChatMemberStatus
      • ChatType
      • ContentType
      • DiceEmoji
      • InlineQueryResultType
      • InputMediaType
      • MaskPositionPoint
      • MenuButtonType
      • MessageEntityType
      • ParseMode
      • PollType
      • StickerType
      • TopicIconColor
      • UpdateType
    • How to download file?
    • How to upload file?
  • Handling events
    • Observer
    • Router
    • Dispatcher
    • Class based handlers
      • BaseHandler
      • CallbackQueryHandler
      • ChosenInlineResultHandler
      • ErrorHandler
      • InlineQueryHandler
      • MessageHandler
      • PollHandler
      • PreCheckoutQueryHandler
      • ShippingQueryHandler
      • ChatMemberHandler
    • Filtering events
      • Command
      • Text
      • ChatMemberUpdated
      • Magic filters
      • MagicData
      • Callback Data Factory & Filter
      • Exceptions
    • Middlewares
    • Finite State Machine
      • Storages
    • Flags
  • Utils
    • Keyboard builder
    • Translation
    • Chat action sender
    • WebApp
    • Callback answer
  • Changelog
  • Contributing
  v: dev-3.x
Versions
latest
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: Union[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: Union[int, str]#

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

build_request(bot: Bot) → Request[source]#

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
editMessageLiveLocation
Copyright © 2023, aiogram Team
Made with Sphinx and @pradyunsg's Furo
On this page
  • exportChatInviteLink
    • ExportChatInviteLink
      • ExportChatInviteLink.chat_id
      • ExportChatInviteLink.build_request()
    • Usage
      • As bot method
      • Method as object
        • With specific bot
        • As reply into Webhook in handler
      • As shortcut from received object