mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
fix(BaseClient): Remove selfbot ability (#6429)
This commit is contained in:
@@ -24,7 +24,7 @@ class BaseClient extends EventEmitter {
|
|||||||
* @type {RESTManager}
|
* @type {RESTManager}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.rest = new RESTManager(this, options._tokenType);
|
this.rest = new RESTManager(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class Client extends BaseClient {
|
|||||||
* @param {ClientOptions} options Options for the client
|
* @param {ClientOptions} options Options for the client
|
||||||
*/
|
*/
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
super(Object.assign({ _tokenType: 'Bot' }, options));
|
super(options);
|
||||||
|
|
||||||
const data = require('worker_threads').workerData ?? process.env;
|
const data = require('worker_threads').workerData ?? process.env;
|
||||||
const defaults = Options.createDefault();
|
const defaults = Options.createDefault();
|
||||||
|
|||||||
@@ -8,10 +8,9 @@ const { Error } = require('../errors');
|
|||||||
const { Endpoints } = require('../util/Constants');
|
const { Endpoints } = require('../util/Constants');
|
||||||
|
|
||||||
class RESTManager {
|
class RESTManager {
|
||||||
constructor(client, tokenPrefix = 'Bot') {
|
constructor(client) {
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.handlers = new Collection();
|
this.handlers = new Collection();
|
||||||
this.tokenPrefix = tokenPrefix;
|
|
||||||
this.versioned = true;
|
this.versioned = true;
|
||||||
this.globalLimit = client.options.restGlobalRateLimit > 0 ? client.options.restGlobalRateLimit : Infinity;
|
this.globalLimit = client.options.restGlobalRateLimit > 0 ? client.options.restGlobalRateLimit : Infinity;
|
||||||
this.globalRemaining = this.globalLimit;
|
this.globalRemaining = this.globalLimit;
|
||||||
@@ -30,7 +29,7 @@ class RESTManager {
|
|||||||
|
|
||||||
getAuth() {
|
getAuth() {
|
||||||
const token = this.client.token ?? this.client.accessToken;
|
const token = this.client.token ?? this.client.accessToken;
|
||||||
if (token) return `${this.tokenPrefix} ${token}`;
|
if (token) return `Bot ${token}`;
|
||||||
throw new Error('TOKEN_MISSING');
|
throw new Error('TOKEN_MISSING');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user