From 35393aa3ef28916c379a0a2001ffc96d0b157d71 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Fri, 29 Jul 2022 20:04:53 +0300 Subject: [PATCH] bugfix --- package.json | 2 +- src/Parser.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f44f712..6237f67 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/Parser.ts b/src/Parser.ts index 3b34fbe..d80797f 100644 --- a/src/Parser.ts +++ b/src/Parser.ts @@ -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; }