Skip to content

Commit

Permalink
add integrationType to generateAuthUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus-Rost authored Apr 3, 2024
1 parent 429cc15 commit 236ec53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ declare class OAuth extends EventEmitter {
redirectUri?: string;
responseType?: "code" | "token";
permissions?: string;
integrationType?: 1 | 0;
guildId?: string;
disableGuildSelect?: boolean;
}): string;
Expand Down
4 changes: 3 additions & 1 deletion lib/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ class OAuth extends RequestHandler {
* @arg {String?} options.responseType The response type, either code or token (token is for client-side web applications only). Defaults to code
* @arg {String | Array} options.scope The scopes for your URL
* @arg {String?} options.state A unique cryptographically secure string (https://discord.com/developers/docs/topics/oauth2#state-and-security)
* @arg {Number?} options.permissions The permissions number for the bot invite (only with bot scope) (https://discord.com/developers/docs/topics/permissions)
* @arg {String?} options.permissions The permissions number for the bot invite (only with bot scope) (https://discord.com/developers/docs/topics/permissions)
* @arg {Number?} options.integrationType The installation context for the authorization, either 0 for guild or 1 for user install (only with applications.commands scope) (https://discord.com/developers/docs/resources/application#installation-context)
* @arg {String?} options.guildId The guild id to pre-fill the bot invite (only with bot scope)
* @arg {Boolean?} options.disableGuildSelect Disallows the user from changing the guild for the bot invite, either true or false (only with bot scope)
* @returns {String}
Expand All @@ -279,6 +280,7 @@ class OAuth extends RequestHandler {
? options.scope.join(" ")
: options.scope,
permissions: options.permissions,
integration_type: options.integrationType,
guild_id: options.guildId,
disable_guild_select: options.disableGuildSelect,
state: options.state,
Expand Down

0 comments on commit 236ec53

Please sign in to comment.