From 5a3b59b4b0007ad6d5e1061a60fbb89b57b65dc0 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Fri, 25 Aug 2017 23:57:29 +0100 Subject: [PATCH] Fix #1685 --- src/client/Client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/Client.js b/src/client/Client.js index 6c575f70f..64b5de8b4 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -287,7 +287,7 @@ class Client extends EventEmitter { if (typeof token !== 'string') throw new Error('TOKEN_INVALID'); token = token.replace(/^Bot\s*/i, ''); this.manager.connectToWebSocket(token, resolve, reject); - }); + }).catch(() => this.destroy()); } /**