Skip to content

Commit

Permalink
fix: move query params and remove default bot scope
Browse files Browse the repository at this point in the history
  • Loading branch information
monbrey committed Jul 3, 2021
1 parent 82138cb commit 2ce4bea
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/client/Client.js
Expand Up @@ -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');
Expand All @@ -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);
Expand Down

0 comments on commit 2ce4bea

Please sign in to comment.