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.