summaryrefslogtreecommitdiff
path: root/handlers.js
diff options
context:
space:
mode:
Diffstat (limited to 'handlers.js')
-rw-r--r--handlers.js22
1 files changed, 22 insertions, 0 deletions
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("<div class=item data-nick="+nick+">"+mode+nick+"</div>")
+ }
+ }
+ });
+}