From 234e84010c8790932f0051df570e0e442cf60ebe Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 13 Apr 2013 17:57:42 +0000 Subject: [PATCH] fix for reddit data with www --- modules/reddit/reddit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/reddit/reddit.js b/modules/reddit/reddit.js index b3c7a2c..97134a8 100644 --- a/modules/reddit/reddit.js +++ b/modules/reddit/reddit.js @@ -24,7 +24,7 @@ var reddit = function(dbot) { this.onLoad = function() { var srHandler = function(event, matches, name) { - this.api.getSubredditInfo(matches[1], function(info) { + this.api.getSubredditInfo(matches[2], function(info) { if(info.data) { info = info.data; var infoString = dbot.t('about_subreddit', { @@ -37,7 +37,7 @@ var reddit = function(dbot) { } }); }.bind(this); - dbot.api.link.addHandler(this.name, /https?:\/\/reddit\.com\/r\/([a-zA-Z0-9]+)/, srHandler); + dbot.api.link.addHandler(this.name, /https?:\/\/(www\.)?reddit\.com\/r\/([a-zA-Z0-9]+)/, srHandler); }.bind(this); };