Skip to content

Commit

Permalink
refactor: remove redundant Client#rest and obsolete RESTManager#destr…
Browse files Browse the repository at this point in the history
…oy (#2022)
  • Loading branch information
SpaceEEC authored and iCrawl committed Oct 11, 2017
1 parent d8f6198 commit 68a3058
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
8 changes: 0 additions & 8 deletions src/client/Client.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const BaseClient = require('./BaseClient');
const Permissions = require('../util/Permissions');
const RESTManager = require('../rest/RESTManager');
const ClientManager = require('./ClientManager');
const ClientVoiceManager = require('./voice/ClientVoiceManager');
const WebSocketManager = require('./websocket/WebSocketManager');
Expand Down Expand Up @@ -42,13 +41,6 @@ class Client extends BaseClient {

this._validateOptions();

/**
* The REST manager of the client
* @type {RESTManager}
* @private
*/
this.rest = new RESTManager(this);

/**
* The manager of the client
* @type {ClientManager}
Expand Down
1 change: 0 additions & 1 deletion src/client/ClientManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class ClientManager {

destroy() {
this.client.ws.destroy();
this.client.rest.destroy();
if (!this.client.user) return Promise.resolve();
if (this.client.user.bot) {
this.client.token = null;
Expand Down
6 changes: 0 additions & 6 deletions src/rest/RESTManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ class RESTManager {
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) {
return new Promise((resolve, reject) => {
handler.push({
Expand Down

0 comments on commit 68a3058

Please # to comment.