diff --git a/modules/dent/dent.js b/modules/dent/dent.js index 6071932..a990984 100644 --- a/modules/dent/dent.js +++ b/modules/dent/dent.js @@ -66,8 +66,8 @@ var dent = function(dbot) { } for(s in this.StatusRegex) { - dbot.api.link.addHandler(this.StatusRegex[s], function(event, matches) { - this.lookup(event, matches[1], s); + dbot.api.link.addHandler(s, this.StatusRegex[s], function(event, matches, name) { + this.lookup(event, matches[1], name); }.bind(this)); } }.bind(this); diff --git a/modules/link/link.js b/modules/link/link.js index 3657a38..e145538 100644 --- a/modules/link/link.js +++ b/modules/link/link.js @@ -33,8 +33,12 @@ var link = function(dbot) { }; this.api = { - 'addHandler': function(regex, handler) { - this.handlers.push({ 'regex': regex, 'callback': handler }); + 'addHandler': function(name, regex, handler) { + this.handlers.push({ + 'name': name, + 'regex': regex, + 'callback': handler + }); } }; @@ -111,7 +115,7 @@ var link = function(dbot) { for(var i=0;i