summaryrefslogtreecommitdiff
path: root/lib/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/index.js')
-rw-r--r--lib/index.js28
1 files 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,
+ })
+ })
+ })
+})
+