From 61b488785f62aea0cd5f932e7267acd3a12ecb87 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 15 Nov 2016 17:59:39 -0500 Subject: le file upload --- lib/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/index.js') diff --git a/lib/index.js b/lib/index.js index a9571f8..6da1c24 100644 --- a/lib/index.js +++ b/lib/index.js @@ -20,7 +20,13 @@ router.post("/_irc/image", multer_upload.single('image'), function(req, res){ res.json({ error: err }) }, success: function(url){ - server.io.send("link", {url: url}) + console.log("SUCCSES!") + console.log(url) + panda.say(panda.channels[0], url) + server.io.emit("link", { + nick: panda.nick, + url: url, + }) } }) }) @@ -40,7 +46,6 @@ router.post("/_irc/post", function(req, res){ }) panda.watch(panda.channels[0], /(https?:\/\/[^\s]+)/g, function(data){ - console.log(data) data.match.forEach(function(match){ server.io.emit("link", { nick: data.nick, -- cgit v1.2.3-70-g09d2