Add debug stuff

This commit is contained in:
Amish Shah
2016-09-04 12:31:10 +01:00
parent f23c07a08e
commit 7475f734ac
5 changed files with 8 additions and 1 deletions

View File

@@ -25,8 +25,10 @@ class ClientManager {
* @param {function} reject Function to run when connection fails
*/
connectToWebSocket(token, resolve, reject) {
this.client.emit('debug', `authenticated using token ${token}`);
this.client.token = token;
this.client.rest.methods.getGateway().then(gateway => {
this.client.emit('debug', `using gateway ${gateway}`);
this.client.ws.connect(gateway);
this.client.once(Constants.Events.READY, () => resolve(token));
}).catch(reject);