This commit is contained in:
Erik 2022-07-29 20:04:53 +03:00
parent 1722140225
commit 35393aa3ef
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "commandparser",
"version": "1.0.13",
"version": "1.0.14",
"description": "Parser meant to parse commands and their options for discord bots",
"main": "build/index.js",
"author": "Navy.gif",

View File

@ -131,10 +131,10 @@ class Parser extends EventEmitter {
params.splice(index, 1, '');
if (aliased) {
(args[flag.name] = flag.clone([_flag])).aliased = true;
(args[flag.name] = flag.clone([_flag], this.resolver)).aliased = true;
currentFlag = null;
} else {
currentFlag = flag.clone();
currentFlag = flag.clone(undefined, this.resolver);
args[flag.name] = currentFlag;
}
index++;
@ -169,7 +169,7 @@ class Parser extends EventEmitter {
this.debug(`Trying ${option.name}, plural: ${option.plural}`);
const cloned = option.clone();
const cloned = option.clone(undefined, this.resolver);
let removed: string[] = [],
error = false;
if (cloned.plural) { // E.g. if the type is CHANNEL**S**, parse out any potential channels from the message
@ -220,7 +220,7 @@ class Parser extends EventEmitter {
if (strings.length) for (const strOpt of stringOpts) {
const val = strings.shift();
if (!val) break;
const cloned = strOpt.clone([val]);
const cloned = strOpt.clone([val], this.resolver);
await cloned.parse(guild);
args[cloned.name] = cloned;
}