diff --git a/README.md b/README.md index 98e3169aa..7b5821e84 100644 --- a/README.md +++ b/README.md @@ -41,4 +41,5 @@ myBot.login("discord email", "discord password", function(e) { ``` ### TODO * Documentation +* Better error handling * Being able to cache new servers and channels as well as ones that are deleted - this is currently only done when a bot is created diff --git a/index.js b/index.js index 8346c3af0..2a62d375b 100644 --- a/index.js +++ b/index.js @@ -161,6 +161,9 @@ exports.Client.prototype.connectWebsocket = function(cb) { } this.websocket.keepAlive = function() { + if(this.readyState !== 1) + return false; + this.sendPacket({ op: 1, d: Date.now()