From 5c4accc58dd04b6950b21d6ef510faee966fdac5 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Fri, 29 Jul 2022 23:09:05 +0300 Subject: [PATCH] bugfix --- .eslintrc.json | 2 +- package.json | 2 +- src/classes/CommandOption.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 66bdfa8..46f5fe6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -106,7 +106,7 @@ "no-extend-native": "warn", "no-extra-bind": "warn", "no-extra-label": "warn", - "no-extra-parens": "warn", + // "no-extra-parens": "warn", "no-floating-decimal": "warn", "no-implicit-coercion": "warn", "no-implicit-globals": "warn", diff --git a/package.json b/package.json index 3a824a6..5c86a37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "commandparser", - "version": "1.0.22", + "version": "1.0.23", "description": "Parser meant to parse commands and their options for discord bots", "main": "build/index.js", "author": "Navy.gif", diff --git a/src/classes/CommandOption.ts b/src/classes/CommandOption.ts index 18a9ce4..c3c6222 100644 --- a/src/classes/CommandOption.ts +++ b/src/classes/CommandOption.ts @@ -102,8 +102,8 @@ class CommandOption implements ICommandOption { } protected STRING() { - if (this._aliased) return { value: this.rawValue?.join(' ') || '', removed: [] }; - if(!this.rawValue) return { error: true }; + if (!this.rawValue) return { error: true }; + if (this._aliased) return { value: this.rawValue.join(' '), removed: [] }; if (this.choices.length) { const found = this.choices.find((c) => { const choice = c as string; @@ -112,7 +112,7 @@ class CommandOption implements ICommandOption { if (found) return { value: found, removed: this._rawValue }; return { error: true }; } - return { value: this._rawValue, removed: this._rawValue }; + return { value: (this._rawValue as string[]).join(' '), removed: this._rawValue }; } }