Skip to content

Commit b327f49

Browse files
authored
fix(Client): generateInvite() scope validation (#9492)
1 parent e262df9 commit b327f49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/discord.js/src/client/Client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ class Client extends BaseClient {
420420
if (!scopes.some(scope => [OAuth2Scopes.Bot, OAuth2Scopes.ApplicationsCommands].includes(scope))) {
421421
throw new DiscordjsTypeError(ErrorCodes.InvalidMissingScopes);
422422
}
423-
if (scopes.some(scope => ![OAuth2Scopes.Bot].includes(scope)) && options.permissions) {
423+
if (!scopes.includes(OAuth2Scopes.Bot) && options.permissions) {
424424
throw new DiscordjsTypeError(ErrorCodes.InvalidScopesWithPermissions);
425425
}
426426
const validScopes = Object.values(OAuth2Scopes);

0 commit comments

Comments
 (0)