From 9a833b1e0eb638c60c4abbb9255ed64a170e4679 Mon Sep 17 00:00:00 2001 From: HyRo Date: Mon, 16 Aug 2021 09:30:35 +0200 Subject: [PATCH] fix(BaseClient): Remove selfbot ability (#6429) --- src/client/BaseClient.js | 2 +- src/client/Client.js | 2 +- src/rest/RESTManager.js | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/client/BaseClient.js b/src/client/BaseClient.js index 65dd18470..a220caaba 100644 --- a/src/client/BaseClient.js +++ b/src/client/BaseClient.js @@ -24,7 +24,7 @@ class BaseClient extends EventEmitter { * @type {RESTManager} * @private */ - this.rest = new RESTManager(this, options._tokenType); + this.rest = new RESTManager(this); } /** diff --git a/src/client/Client.js b/src/client/Client.js index 6c3b3b4e5..5550a371e 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -35,7 +35,7 @@ class Client extends BaseClient { * @param {ClientOptions} options Options for the client */ constructor(options) { - super(Object.assign({ _tokenType: 'Bot' }, options)); + super(options); const data = require('worker_threads').workerData ?? process.env; const defaults = Options.createDefault(); diff --git a/src/rest/RESTManager.js b/src/rest/RESTManager.js index 61fef747c..9d5cd2751 100644 --- a/src/rest/RESTManager.js +++ b/src/rest/RESTManager.js @@ -8,10 +8,9 @@ const { Error } = require('../errors'); const { Endpoints } = require('../util/Constants'); class RESTManager { - constructor(client, tokenPrefix = 'Bot') { + constructor(client) { this.client = client; this.handlers = new Collection(); - this.tokenPrefix = tokenPrefix; this.versioned = true; this.globalLimit = client.options.restGlobalRateLimit > 0 ? client.options.restGlobalRateLimit : Infinity; this.globalRemaining = this.globalLimit; @@ -30,7 +29,7 @@ class RESTManager { getAuth() { const token = this.client.token ?? this.client.accessToken; - if (token) return `${this.tokenPrefix} ${token}`; + if (token) return `Bot ${token}`; throw new Error('TOKEN_MISSING'); }