From 8151122b8015e247c23cd6ab93ca07b0567840c5 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 13 Apr 2013 15:41:13 +0000 Subject: [PATCH] oh, handler was checking existence of matches[2] for some stupid reason [Close #353] --- modules/imgur/imgur.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index 217f159..e5efccf 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -77,15 +77,15 @@ var imgur = function(dbot) { this.onLoad = function() { var imgurHandler = function(event, matches, name) { - if(matches[2]) { // TODO: handle this in the regex + if(matches[1]) { this.api.getImageInfo(matches[1], function(imgData) { var info = this.internalAPI.infoString(imgData); if(info) event.reply(info); }.bind(this)); } }.bind(this); - dbot.api.link.addHandler(this.name, /http:\/\/i\.imgur\.com\/([a-zA-Z0-9]+)\.([jpg|png|gif])/, imgurHandler); - dbot.api.link.addHandler(this.name, /\bhttps?:\/\/imgur\.com\/([a-zA-Z0-9]+)\b/i, imgurHandler); + dbot.api.link.addHandler(this.name, /https?:\/\/i\.imgur\.com\/([a-zA-Z0-9]+)\.([jpg|png|gif])/, imgurHandler); + dbot.api.link.addHandler(this.name, /https?:\/\/imgur\.com\/([a-zA-Z0-9]+)/, imgurHandler); }.bind(this); };