From 72ac41d632603f7ff1179c3c04fa2a7ee40a6c4b Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 21 Dec 2013 23:24:18 +0000 Subject: [PATCH] that should fix the shitty regex too --- 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 3e4fdc2..4debef6 100644 --- a/modules/reddit/reddit.js +++ b/modules/reddit/reddit.js @@ -270,10 +270,10 @@ var reddit = function(dbot) { }.bind(this); dbot.api.link.addHandler(this.name, // I'm so sorry, Jesus. - /https?:\/\/(www|pay\.)?reddit\.com\/r\/([a-zA-Z0-9]+)(\/comments\/([a-zA-Z0-9]+)?\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)?)?/, + /https?:\/\/([a-z]+\.)?reddit\.com\/r\/([a-zA-Z0-9]+)(\/comments\/([a-zA-Z0-9]+)?\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)?)?/, rHandler); dbot.api.link.addHandler(this.name + 'short', - /https?:\/\/(www\.)?redd.it\/([a-zA-Z0-9]+)/, + /https?:\/\/([a-z]\.)?redd.it\/([a-zA-Z0-9]+)/, function(match, name, callback) { this.api.getPostInfo(match[2], function(info) { if(info) {