File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1320,8 +1320,9 @@ async def create_invite(
13201320 if target_type is InviteTarget .unknown :
13211321 raise ValueError ('Cannot create invite with an unknown target type' )
13221322
1323- flags = GuildInviteFlags . _from_value ( 0 )
1323+ flags : Optional [ GuildInviteFlags ] = None
13241324 if guest_invite :
1325+ flags = GuildInviteFlags ._from_value (0 )
13251326 flags .is_guest_invite = True
13261327
13271328 data = await self ._state .http .create_invite (
@@ -1334,7 +1335,7 @@ async def create_invite(
13341335 target_type = target_type .value if target_type else None ,
13351336 target_user_id = target_user .id if target_user else None ,
13361337 target_application_id = target_application_id ,
1337- flags = flags .value ,
1338+ flags = flags .value if flags else None ,
13381339 )
13391340 return Invite .from_incomplete (data = data , state = self ._state )
13401341
Original file line number Diff line number Diff line change @@ -1853,7 +1853,7 @@ def create_invite(
18531853 if target_application_id :
18541854 payload ['target_application_id' ] = str (target_application_id )
18551855
1856- if flags is not None :
1856+ if flags :
18571857 payload ['flags' ] = flags
18581858
18591859 return self .request (r , reason = reason , json = payload )
You can’t perform that action at this time.
0 commit comments