This commit is contained in:
Dragon Fire
2024-03-22 19:56:04 -04:00
parent a6685b3a54
commit 55fe6947b0
+3 -3
View File
@@ -41,19 +41,19 @@ module.exports = class Argument {
get invalidText() { get invalidText() {
if (this.oneOf) { if (this.oneOf) {
return `It must be one of the following: ${list(arg.oneOf, 'or')}`; return `It must be one of the following: ${list(this.oneOf, 'or')}`;
} else if (this.max !== null && this.min !== null && (this.typeID === 'integer' || this.typeID === 'float')) { } else if (this.max !== null && this.min !== null && (this.typeID === 'integer' || this.typeID === 'float')) {
return `It must be a number from ${this.min} to ${this.max}.`; return `It must be a number from ${this.min} to ${this.max}.`;
} else if (this.max !== null && this.min === null && (this.typeID === 'integer' || this.typeID === 'float')) { } else if (this.max !== null && this.min === null && (this.typeID === 'integer' || this.typeID === 'float')) {
return `It must be a number less than or equal to ${this.max}.`; return `It must be a number less than or equal to ${this.max}.`;
} else if (this.min !== null && this.max === null && (this.typeID === 'integer' || this.typeID === 'float')) { } else if (this.min !== null && this.max === null && (this.typeID === 'integer' || this.typeID === 'float')) {
return `It must be a number greater than or equal to ${this.min}.` return `It must be a number greater than or equal to ${this.min}.`;
} else if (this.min !== null && this.max !== null && this.typeID === 'string') { } else if (this.min !== null && this.max !== null && this.typeID === 'string') {
return `It must be at least ${this.min} characters long and at most ${this.max} characters long.`; return `It must be at least ${this.min} characters long and at most ${this.max} characters long.`;
} else if (this.min !== null && this.max === null && this.typeID === 'string') { } else if (this.min !== null && this.max === null && this.typeID === 'string') {
return `It must be at least ${this.min} characters long.`; return `It must be at least ${this.min} characters long.`;
} else if (this.max !== null && this.min === null && this.typeID === 'string') { } else if (this.max !== null && this.min === null && this.typeID === 'string') {
return `It must be at most ${this.max} characters long.`; return `It must be at most ${this.max} characters long.`;
} }
return `It must be a ${this.typeID}.`; return `It must be a ${this.typeID}.`;
} }