bugfix
This commit is contained in:
parent
e2aac258a7
commit
5c4accc58d
@ -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",
|
||||||
|
@ -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",
|
||||||
|
@ -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 };
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user