6060from .voice_client import VoiceClient , VoiceProtocol
6161from .sticker import GuildSticker , StickerItem
6262from . import utils
63+ from .flags import GuildInviteFlags
6364
6465__all__ = (
6566 'Snowflake' ,
@@ -1257,6 +1258,7 @@ async def create_invite(
12571258 target_type : Optional [InviteTarget ] = None ,
12581259 target_user : Optional [User ] = None ,
12591260 target_application_id : Optional [int ] = None ,
1261+ guest_invite : bool = False ,
12601262 ) -> Invite :
12611263 """|coro|
12621264
@@ -1295,6 +1297,12 @@ async def create_invite(
12951297 The id of the embedded application for the invite, required if ``target_type`` is :attr:`.InviteTarget.embedded_application`.
12961298
12971299 .. versionadded:: 2.0
1300+ guest_invite: :class:`bool`
1301+ Whether the invite is a guest invite.
1302+
1303+ This is only available to guilds that contain ``GUESTS_ENABLED`` in :attr:`.Guild.features`.
1304+
1305+ .. versionadded:: 2.6
12981306
12991307 Raises
13001308 -------
@@ -1312,6 +1320,10 @@ async def create_invite(
13121320 if target_type is InviteTarget .unknown :
13131321 raise ValueError ('Cannot create invite with an unknown target type' )
13141322
1323+ flags = GuildInviteFlags ._from_value (0 )
1324+ if guest_invite :
1325+ flags .is_guest_invite = True
1326+
13151327 data = await self ._state .http .create_invite (
13161328 self .id ,
13171329 reason = reason ,
@@ -1322,6 +1334,7 @@ async def create_invite(
13221334 target_type = target_type .value if target_type else None ,
13231335 target_user_id = target_user .id if target_user else None ,
13241336 target_application_id = target_application_id ,
1337+ flags = flags .value ,
13251338 )
13261339 return Invite .from_incomplete (data = data , state = self ._state )
13271340
0 commit comments