From b95058399e48b32eacfff439d6c283f1f7999566 Mon Sep 17 00:00:00 2001 From: abalabahaha Date: Fri, 29 Jul 2016 05:56:50 +0900 Subject: [PATCH] Enable autoReconnect by default --- docs/docs_client.rst | 2 +- lib/Client/Client.js | 2 +- lib/Client/InternalClient.js | 1 - src/Client/Client.js | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/docs_client.rst b/docs/docs_client.rst index ad6d246f1..05288f882 100755 --- a/docs/docs_client.rst +++ b/docs/docs_client.rst @@ -17,7 +17,7 @@ Client takes an options object, and supports the following options:. autoReconnect ~~~~~~~~~~~~~ -Have discord.js autoreconnect when connection is lost. +Have discord.js autoreconnect when connection is lost. This is enabled by default. compress ~~~~~~~~ diff --git a/lib/Client/Client.js b/lib/Client/Client.js index cec385c16..c162af2ec 100644 --- a/lib/Client/Client.js +++ b/lib/Client/Client.js @@ -72,7 +72,7 @@ var Client = (function (_EventEmitter) { */ this.options = options || {}; this.options.compress = options.compress || !process.browser; - this.options.autoReconnect = options.autoReconnect || false; + this.options.autoReconnect = options.autoReconnect || true; this.options.rateLimitAsError = options.rateLimitAsError || false; this.options.largeThreshold = options.largeThreshold || 250; this.options.maxCachedMessages = options.maxCachedMessages || 1000; diff --git a/lib/Client/InternalClient.js b/lib/Client/InternalClient.js index dd3f265ea..34fff70be 100644 --- a/lib/Client/InternalClient.js +++ b/lib/Client/InternalClient.js @@ -249,7 +249,6 @@ var InternalClient = (function () { this.resolver = new _ResolverResolver2["default"](this); this.readyTime = null; this.messageAwaits = {}; - this.retryAfters = {}; this.buckets = { "bot:msg:dm": new _UtilBucket2["default"](5, 5000), "bot:msg:global": new _UtilBucket2["default"](50, 10000), diff --git a/src/Client/Client.js b/src/Client/Client.js index 9ee139a47..3b0bb5aa7 100755 --- a/src/Client/Client.js +++ b/src/Client/Client.js @@ -46,7 +46,7 @@ export default class Client extends EventEmitter { */ this.options = options || {}; this.options.compress = options.compress || (!process.browser); - this.options.autoReconnect = options.autoReconnect || false; + this.options.autoReconnect = options.autoReconnect || true; this.options.rateLimitAsError = options.rateLimitAsError || false; this.options.largeThreshold = options.largeThreshold || 250; this.options.maxCachedMessages = options.maxCachedMessages || 1000;