diff --git a/src/client/Client.js b/src/client/Client.js index 87ecb80444d6..399435475af4 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -404,6 +404,10 @@ class Client extends BaseClient { if (typeof options !== 'object') throw new TypeError('INVALID_TYPE', 'options', 'object', true); if (!this.application) throw new Error('CLIENT_NOT_READY', 'generate an invite link'); + const query = new URLSearchParams({ + client_id: this.application.id, + }); + const scopes = options.scopes; if (typeof scopes === 'undefined') { throw new TypeError('INVITE_MISSING_SCOPES'); @@ -421,11 +425,6 @@ class Client extends BaseClient { } query.set('scope', [...scopes].join(' ')); - const query = new URLSearchParams({ - client_id: this.application.id, - scope: 'bot', - }); - if (options.permissions && options.scopes) { const permissions = Permissions.resolve(options.permissions); if (permissions) query.set('permissions', permissions);