mirror of
https://github.com/danbulant/discord.js
synced 2026-07-07 12:11:11 +00:00
refactor: remove redundant Client#rest and obsolete RESTManager#destroy (#2022)
This commit is contained in:
parent
d8f6198a12
commit
68a30584db
3 changed files with 0 additions and 15 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
const BaseClient = require('./BaseClient');
|
const BaseClient = require('./BaseClient');
|
||||||
const Permissions = require('../util/Permissions');
|
const Permissions = require('../util/Permissions');
|
||||||
const RESTManager = require('../rest/RESTManager');
|
|
||||||
const ClientManager = require('./ClientManager');
|
const ClientManager = require('./ClientManager');
|
||||||
const ClientVoiceManager = require('./voice/ClientVoiceManager');
|
const ClientVoiceManager = require('./voice/ClientVoiceManager');
|
||||||
const WebSocketManager = require('./websocket/WebSocketManager');
|
const WebSocketManager = require('./websocket/WebSocketManager');
|
||||||
|
|
@ -42,13 +41,6 @@ class Client extends BaseClient {
|
||||||
|
|
||||||
this._validateOptions();
|
this._validateOptions();
|
||||||
|
|
||||||
/**
|
|
||||||
* The REST manager of the client
|
|
||||||
* @type {RESTManager}
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
this.rest = new RESTManager(this);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The manager of the client
|
* The manager of the client
|
||||||
* @type {ClientManager}
|
* @type {ClientManager}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@ class ClientManager {
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
this.client.ws.destroy();
|
this.client.ws.destroy();
|
||||||
this.client.rest.destroy();
|
|
||||||
if (!this.client.user) return Promise.resolve();
|
if (!this.client.user) return Promise.resolve();
|
||||||
if (this.client.user.bot) {
|
if (this.client.user.bot) {
|
||||||
this.client.token = null;
|
this.client.token = null;
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,6 @@ class RESTManager {
|
||||||
return Endpoints.CDN(this.client.options.http.cdn);
|
return Endpoints.CDN(this.client.options.http.cdn);
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
for (const handler of Object.values(this.handlers)) {
|
|
||||||
if (handler.destroy) handler.destroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
push(handler, apiRequest) {
|
push(handler, apiRequest) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
handler.push({
|
handler.push({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue