From fbdec17670e48d22d11494e701fae40a2ad9970d Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 16 Jun 2014 15:53:27 +0000 Subject: [PATCH] dont post the thingy if there is no category or author --- modules/rss/rss.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/rss/rss.js b/modules/rss/rss.js index 6385f05..586b3a4 100644 --- a/modules/rss/rss.js +++ b/modules/rss/rss.js @@ -52,8 +52,13 @@ var rss = function(dbot) { }; request(options, function (error, response, body) { - if (!error && response.statusCode == 200) { - dbot.say(feed.server,feed.channel,"["+feed.name+"] ["+rss.title+"] [Post by "+rss.author+" in "+rss.categories[0]+"] - "+body.id); + if (!error && response.statusCode === 200) { + var rString = "["+feed.name+"] ["+rss.title+"] "; + if(rss.author && rss.categories[0]) { + rString += "[Post by "+rss.author+" in "+rss.categories[0]+"] "; + } + rString += "- "+body.id; + dbot.say(feed.server,feed.channel, rString); } else { dbot.say(feed.server,feed.channel,"RSS: Request to shorten URL returned: "+body.id); }