From 7553643e39a16bacfb2ac6563a8558ac475042bc Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 15 Nov 2016 17:52:09 -0500 Subject: link to socket workin --- lib/panda.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/panda.js') diff --git a/lib/panda.js b/lib/panda.js index bb4b6ed..1757121 100644 --- a/lib/panda.js +++ b/lib/panda.js @@ -76,7 +76,7 @@ var message_queue = async.queue(function(task, done){ console.log("connecting..") -client.addListener('registered', function (message) { +client.addListener('registered', function () { console.log("..registered!") }) @@ -88,21 +88,22 @@ client.addListener('error', function (err) { console.log("..error!", err) }) -client.addListener('join', function (channel, nick, message) { +client.addListener('join', function (channel, nick) { console.log("* " + nick + " joined " + channel) if (nick == 'panda' && channel == '#sally') { panda.login() } }) -client.addListener('message', function (nick, to, text, message) { +client.addListener('message', function (nick, to, text) { watchers.forEach(function(watcher){ + console.log(nick, to, text, watcher) if (to === watcher.channel) { - var match = watcher.regexp.match(text) + var match = text.match(watcher.regexp) if (match) { - cb({ + watcher.cb({ channel: to, nick: nick, - message: message, + text: text, match: match, }) } -- cgit v1.2.3-70-g09d2