This commit is contained in:
Erik 2022-07-29 23:09:05 +03:00
parent e2aac258a7
commit 5c4accc58d
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
3 changed files with 5 additions and 5 deletions

View File

@ -106,7 +106,7 @@
"no-extend-native": "warn", "no-extend-native": "warn",
"no-extra-bind": "warn", "no-extra-bind": "warn",
"no-extra-label": "warn", "no-extra-label": "warn",
"no-extra-parens": "warn", // "no-extra-parens": "warn",
"no-floating-decimal": "warn", "no-floating-decimal": "warn",
"no-implicit-coercion": "warn", "no-implicit-coercion": "warn",
"no-implicit-globals": "warn", "no-implicit-globals": "warn",

View File

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

View File

@ -102,8 +102,8 @@ class CommandOption implements ICommandOption {
} }
protected STRING() { 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) { if (this.choices.length) {
const found = this.choices.find((c) => { const found = this.choices.find((c) => {
const choice = c as string; const choice = c as string;
@ -112,7 +112,7 @@ class CommandOption implements ICommandOption {
if (found) return { value: found, removed: this._rawValue }; if (found) return { value: found, removed: this._rawValue };
return { error: true }; return { error: true };
} }
return { value: this._rawValue, removed: this._rawValue }; return { value: (this._rawValue as string[]).join(' '), removed: this._rawValue };
} }
} }