From dc351c1c2d68215577d742d32e143feba15a7a08 Mon Sep 17 00:00:00 2001 From: okfprojz Date: Tue, 15 Nov 2016 18:18:54 -0500 Subject: channels stuff --- lib/index.js | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/lib/index.js b/lib/index.js index 6da1c24..ac2906e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -45,11 +45,27 @@ router.post("/_irc/post", function(req, res){ res.sendStatus(200) }) -panda.watch(panda.channels[0], /(https?:\/\/[^\s]+)/g, function(data){ - data.match.forEach(function(match){ - server.io.emit("link", { - nick: data.nick, - url: match, +/* +panda.channels.forEach(function(channel){ + panda.watch(channel, new Regexp(panda.nick), function(data){ + data.match.forEach(function(match){ + server.io.emit("msg", { + nick: data.nick, + msg: msg, + }) }) }) -}) \ No newline at end of file +}) +*/ + +panda.channels.forEach(function(channel){ + panda.watch(channel, /(https?:\/\/[^\s]+)/g, function(data){ + data.match.forEach(function(match){ + server.io.emit("link", { + nick: data.nick, + url: match, + }) + }) + }) +}) + -- cgit v1.2.3-70-g09d2