feat: If a required argument is not supplied, ask for it and then resolve the command listener.

Thanks to @amovah for his contributions
This commit is contained in:
Mahdi Dibaiee
2015-07-09 15:46:27 +04:30
parent 2aaed21195
commit 41ca326173
5 changed files with 162 additions and 107 deletions

View File

@ -15,6 +15,7 @@ var ESCAPABLE = '.^$*+?()[{\\|}]'.split('');
var REQUIRED = 0;
var OPTIONAL = 1;
var REST = 2;
/**
* Parses a message for arguments, based on format
@ -71,6 +72,7 @@ function argumentParser(format, string) {
});
format = format.replace(FORMAT_REST, function (full, arg, offset) {
indexes.push({ offset: offset, arg: arg });
params[arg] = REST;
return getFormat(null, 'rest');
});