regex for usage

This commit is contained in:
reality 2014-09-13 19:48:28 +00:00
parent 2570eb99a6
commit e3a6f53537

View File

@ -2,7 +2,7 @@ var _ = require('underscore')._,
request = require('request'); request = require('request');
var commands = function(dbot) { var commands = function(dbot) {
return { var commands = {
'usage': function(event) { 'usage': function(event) {
var commandName = event.params[1]; var commandName = event.params[1];
if(_.has(dbot.usage, commandName)) { if(_.has(dbot.usage, commandName)) {
@ -60,6 +60,9 @@ var commands = function(dbot) {
} }
} }
}; };
commands['usage'].regex = [/usage ([^ ]+)/, 2];
return commands;
}; };
exports.fetch = function(dbot) { exports.fetch = function(dbot) {