From e0840642f1710a5f50d3508d3fe661fdc17d9d56 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Sun, 16 Oct 2016 21:41:00 +0100 Subject: Add kick handler --- commands.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'commands.js') diff --git a/commands.js b/commands.js index 59be364..138c55f 100644 --- a/commands.js +++ b/commands.js @@ -67,10 +67,11 @@ module.exports.joinChannel = function (channel, sendJoin) { } module.exports.removeChannel = function(channel, sendPart) { - var channelObj = client.channel(channel) + chanId = $("[data-tab='"+channel+"'].chat").attr("data-id"); $("[data-tab='"+channel+"']").remove(); if (sendPart) { + var channelObj = client.channel(channel) channelObj.part(); } while ($("[data-id="+(chanId-1)+"]").length == 0 && chanId >=0) { -- cgit v1.2.3