6060from .voice_client import VoiceClient , VoiceProtocol
6161from .sticker import GuildSticker , StickerItem
6262from . import utils
63+ from .flags import InviteFlags
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 : bool = False ,
12601262 ) -> Invite :
12611263 """|coro|
12621264
@@ -1295,6 +1297,10 @@ 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: :class:`bool`
1301+ Whether the invite is a guest invite.
1302+
1303+ .. versionadded:: 2.6
12981304
12991305 Raises
13001306 -------
@@ -1312,6 +1318,11 @@ async def create_invite(
13121318 if target_type is InviteTarget .unknown :
13131319 raise ValueError ('Cannot create invite with an unknown target type' )
13141320
1321+ flags : Optional [InviteFlags ] = None
1322+ if guest :
1323+ flags = InviteFlags ._from_value (0 )
1324+ flags .guest = True
1325+
13151326 data = await self ._state .http .create_invite (
13161327 self .id ,
13171328 reason = reason ,
@@ -1322,6 +1333,7 @@ async def create_invite(
13221333 target_type = target_type .value if target_type else None ,
13231334 target_user_id = target_user .id if target_user else None ,
13241335 target_application_id = target_application_id ,
1336+ flags = flags .value if flags else None ,
13251337 )
13261338 return Invite .from_incomplete (data = data , state = self ._state )
13271339
0 commit comments