Skip to content

Commit

Permalink
omit default integration_type
Browse files Browse the repository at this point in the history
  • Loading branch information
sebm253 committed Mar 20, 2024
1 parent 7d24eb0 commit 1581c40
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions oauth2/client_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ func (c *clientImpl) GenerateAuthorizationURL(params AuthorizationURLParams) str
func (c *clientImpl) GenerateAuthorizationURLState(params AuthorizationURLParams) (string, string) {
state := c.StateController().NewState(params.RedirectURI)
values := discord.QueryValues{
"client_id": c.id,
"redirect_uri": params.RedirectURI,
"response_type": "code",
"scope": discord.JoinScopes(params.Scopes),
"state": state,
"integration_type": params.IntegrationType,
"client_id": c.id,
"redirect_uri": params.RedirectURI,
"response_type": "code",
"scope": discord.JoinScopes(params.Scopes),
"state": state,
}

if params.Permissions != discord.PermissionsNone {
Expand All @@ -72,6 +71,9 @@ func (c *clientImpl) GenerateAuthorizationURLState(params AuthorizationURLParams
if params.DisableGuildSelect {
values["disable_guild_select"] = true
}
if params.IntegrationType != 0 {
values["integration_type"] = params.IntegrationType
}
return discord.AuthorizeURL(values), state
}

Expand Down

0 comments on commit 1581c40

Please sign in to comment.