Skip to content

Commit

Permalink
clean up for first release
Browse files Browse the repository at this point in the history
  • Loading branch information
devsnek committed Nov 17, 2016
1 parent b9b7356 commit 10394b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/RESTClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = class RESTClient {
return new Promise((resolve, reject) => {
headers.Authorization = `Bearer ${this.client.accessToken}`;
superagent[method.toLowerCase()](`https://${this.client.hostAndPort}${path}`)
.set(headers).send(body).then(resolve, reject);
.set(headers).send(body).then(res => resolve(res.body), reject);
});
}

Expand Down
6 changes: 2 additions & 4 deletions src/RPCClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

const EventEmitter = require('events').EventEmitter;
const { RPCCommands, RPCEvents, RPCErrors } = require('./Constants');
if (typeof WebSocket === 'undefined') { const WebSocket = require('ws'); }
if (typeof WebSocket === 'undefined') { const WebSocket = require('ws'); } // eslint-disable-line
const superagent = require('superagent');
const uuid = require('uuid').v4;
const RESTClient = require('./RESTClient');
Expand All @@ -31,9 +31,7 @@ class RPCClient {
}

connect (accessToken = this.accessToken, tries = 0) {
if (this.connected) {
return;
}
if (this.connected) return;
this.accessToken = accessToken;
const port = 6463 + (tries % 10);
this.hostAndPort = `${uuid()}.discordapp.io:${port}`;
Expand Down

0 comments on commit 10394b7

Please sign in to comment.