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); };