From e3a6f5353735dab6a2a4103584a6bb437c0969ff Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 13 Sep 2014 19:48:28 +0000 Subject: [PATCH] regex for usage --- modules/command/commands.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/command/commands.js b/modules/command/commands.js index b5860cc..d5d5bbb 100644 --- a/modules/command/commands.js +++ b/modules/command/commands.js @@ -2,7 +2,7 @@ var _ = require('underscore')._, request = require('request'); var commands = function(dbot) { - return { + var commands = { 'usage': function(event) { var commandName = event.params[1]; if(_.has(dbot.usage, commandName)) { @@ -60,6 +60,9 @@ var commands = function(dbot) { } } }; + commands['usage'].regex = [/usage ([^ ]+)/, 2]; + + return commands; }; exports.fetch = function(dbot) {