summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorokfprojz <jules+okfprojz@okfoc.us>2016-11-15 18:18:54 -0500
committerokfprojz <jules+okfprojz@okfoc.us>2016-11-15 18:18:54 -0500
commitdc351c1c2d68215577d742d32e143feba15a7a08 (patch)
treedb764ef236947cf2cd6b160998e3e8006c02b47e
parent8b9b56c92d791dbb05348196f0e28426f950e980 (diff)
channels stuff
-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,
+ })
+ })
+ })
+})
+