From b327f4925ff557e0aa8273d7f017aa616226ca06 Mon Sep 17 00:00:00 2001 From: Almeida Date: Mon, 1 May 2023 23:11:11 +0100 Subject: [PATCH] fix(Client): `generateInvite()` scope validation (#9492) --- packages/discord.js/src/client/Client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/discord.js/src/client/Client.js b/packages/discord.js/src/client/Client.js index 83c44ed2ede8..8900474c32b0 100644 --- a/packages/discord.js/src/client/Client.js +++ b/packages/discord.js/src/client/Client.js @@ -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);