mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(Client): generateInvite() scope validation (#9492)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user