From f2313c7da4185a003bdef43f903c59ead1e7dbe4 Mon Sep 17 00:00:00 2001 From: benji7425 Date: Mon, 20 Nov 2017 01:08:37 +0000 Subject: [PATCH] git subrepo pull discord-bot-core subrepo: subdir: "discord-bot-core" merged: "a25486f" upstream: origin: "git@github.com:benji7425/discord-bot-core.git" branch: "master" commit: "a25486f" git-subrepo: version: "0.3.1" origin: "???" commit: "???" --- discord-bot-core/.gitrepo | 4 ++-- discord-bot-core/Client.js | 11 +++++------ discord-bot-core/internal-config.json | 6 +----- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/discord-bot-core/.gitrepo b/discord-bot-core/.gitrepo index 782a0ba..6cbdc2b 100644 --- a/discord-bot-core/.gitrepo +++ b/discord-bot-core/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = git@github.com:benji7425/discord-bot-core.git branch = master - commit = 5c4a0b857e5d1267e7cd85aa013625e67d614726 - parent = 1f40c8800b5e74c96a2a83398d55964fce0ee5cb + commit = a25486f0bb65d592e0181e4531a7cc1e69f58e96 + parent = ccd9a172f89988157d43643d475e9027db258ad5 method = merge cmdver = 0.3.1 diff --git a/discord-bot-core/Client.js b/discord-bot-core/Client.js index cbd7e00..0440f01 100644 --- a/discord-bot-core/Client.js +++ b/discord-bot-core/Client.js @@ -61,8 +61,8 @@ module.exports = class Client extends Discord.Client { } onDebug(info) { - if (!InternalConfig.debugIgnores.some(x => info.startsWith(x))) - CoreUtil.dateDebug(info); + info = info.replace(/Authenticated using token [^ ]+/, "Authenticated using token [redacted]"); + CoreUtil.dateDebug(info); } onGuildCreate(guild) { @@ -76,11 +76,11 @@ module.exports = class Client extends Discord.Client { } onUnhandledException(client, err) { - CoreUtil.dateError(err.message || err); + CoreUtil.dateError(err); CoreUtil.dateLog("Destroying existing client..."); client.destroy().then(() => { CoreUtil.dateLog("Client destroyed, recreating..."); - client.login(client._token); + setTimeout(() => client.login(client._token), InternalConfig.reconnectTimeout); }); } @@ -92,8 +92,7 @@ module.exports = class Client extends Discord.Client { } /** - * @param {*} json - * @param {*} guildDataModel + * @param {*} json */ fromJSON(json) { const guildsData = Object.keys(json); diff --git a/discord-bot-core/internal-config.json b/discord-bot-core/internal-config.json index 86adf93..5ae2d05 100644 --- a/discord-bot-core/internal-config.json +++ b/discord-bot-core/internal-config.json @@ -3,9 +3,5 @@ "website": "https://benji7425.github.io", "discordInvite": "https://discord.gg/SSkbwSJ", "defaultDMResponse": "This bot does not have any handling for direct messages. To learn more or get help please visit %s, or join my Discord server here: %s", - "debugIgnores":[ - "[ws] [connection] Sending a heartbeat", - "[ws] [connection] Heartbeat acknowledged", - "Authenticated using token" - ] + "reconnectTimeout": 5000 } \ No newline at end of file