Skip to content

Commit

Permalink
fix(Client): generateInvite() scope validation (#9492)
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx committed May 1, 2023
1 parent e262df9 commit b327f49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/discord.js/src/client/Client.js
Expand Up @@ -420,7 +420,7 @@ class Client extends BaseClient {
if (!scopes.some(scope => [OAuth2Scopes.Bot, OAuth2Scopes.ApplicationsCommands].includes(scope))) {
throw new DiscordjsTypeError(ErrorCodes.InvalidMissingScopes);
}
if (scopes.some(scope => ![OAuth2Scopes.Bot].includes(scope)) && options.permissions) {
if (!scopes.includes(OAuth2Scopes.Bot) && options.permissions) {
throw new DiscordjsTypeError(ErrorCodes.InvalidScopesWithPermissions);
}
const validScopes = Object.values(OAuth2Scopes);
Expand Down

0 comments on commit b327f49

Please sign in to comment.