File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -467,6 +467,7 @@ def generate_uri(
467467 scope : Union [str , list [str ]],
468468 state : Optional [str ] = None ,
469469 skip_prompt : Optional [bool ] = False ,
470+ integration_type : Optional [Literal ["guild" , "user" ]] = "user" ,
470471 response_type : Optional [Literal ["code" , "token" ]] = "code" ,
471472 guild_id : Optional [Union [int , str ]] = None ,
472473 disable_guild_select : Optional [bool ] = None ,
@@ -493,4 +494,6 @@ def generate_uri(
493494 "disable_guild_select" : disable_guild_select ,
494495 "permissions" : permissions ,
495496 }
497+ if "application.commands" in scope :
498+ params ["integration_type" ] = 0 if integration_type == "guild" else 1
496499 return f"https://discord.com/oauth2/authorize?{ parse .urlencode ({key : value for key , value in params .items () if value is not None })} "
Original file line number Diff line number Diff line change @@ -438,6 +438,7 @@ def generate_uri(
438438 scope : Union [str , list [str ]],
439439 state : Optional [str ] = None ,
440440 skip_prompt : Optional [bool ] = False ,
441+ integration_type : Optional [Literal ["guild" , "user" ]] = "user" ,
441442 response_type : Optional [Literal ["code" , "token" ]] = "code" ,
442443 guild_id : Optional [Union [int , str ]] = None ,
443444 disable_guild_select : Optional [bool ] = None ,
@@ -464,4 +465,6 @@ def generate_uri(
464465 "disable_guild_select" : disable_guild_select ,
465466 "permissions" : permissions ,
466467 }
468+ if "application.commands" in scope :
469+ params ["integration_type" ] = 0 if integration_type == "guild" else 1
467470 return f"https://discord.com/oauth2/authorize?{ parse .urlencode ({key : value for key , value in params .items () if value is not None })} "
You can’t perform that action at this time.
0 commit comments