From b8224ffa33869084e3da9f94f48624c2ce0c691f Mon Sep 17 00:00:00 2001 From: lmtierney Date: Tue, 13 Sep 2016 14:20:39 -0500 Subject: [PATCH] Just delete client on max retry, don't disconnect There's nothing to disconnect, throws an error --- lib/bot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bot.js b/lib/bot.js index b384b3c..cdc0d7b 100644 --- a/lib/bot.js +++ b/lib/bot.js @@ -138,7 +138,7 @@ class Bot { clearTimeout(client.timer); } } else if (client != null) { - this.ircClients[user.id].timer = setTimeout(() => { + client.timer = setTimeout(() => { this.deleteClient(user, `Slack user ${user.name} went away.`); }, this.ircTimeout * 1000); } @@ -320,7 +320,7 @@ class Bot { client.on('abort', () => { logger.error(`${user.name}: Maximum IRC retry count reached, exiting.`); - this.deleteClient(user, 'Abort.'); + delete this.ircClients[user.id]; }); // Queued messages are sent once we know the client is in a channel.