From f3d0c81c7b004218665ab1123fb6c8915b190ce0 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Wed, 8 Jun 2016 00:13:12 +0100 Subject: WIP adding irc-framework, debugging --- handlers.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 handlers.js (limited to 'handlers.js') diff --git a/handlers.js b/handlers.js new file mode 100644 index 0000000..88259c7 --- /dev/null +++ b/handlers.js @@ -0,0 +1,22 @@ +module.exports.handleCommands = function(client) { + + client.on('registered', function(event) { + console.log(event); + }); + + client.on('userlist', function(event) { + console.log(event); + channel = event.channel.replace("#","") + console.log(channel); + if($(".ui.tab[data-tab=chan-"+channel+"]").length == 0) { + console.log("there"); + joinChannel(channel, false) + } + for(nick in event.nicks) { + var mode = nicks[nick]; + if($(".ui.users[data-tab=chan-"+channel+"] [data-nick="+nick+"]").length == 0) { + $(".ui.users[data-tab=chan-"+channel+"]").append("
"+mode+nick+"
") + } + } + }); +} -- cgit v1.2.3