Several million refactoring of existing slash commands with enums (really)

This commit is contained in:
Wolfsblvt
2024-06-17 07:04:10 +02:00
parent 6f7ef25369
commit 66d609c35f
15 changed files with 332 additions and 132 deletions

View File

@ -1,4 +1,5 @@
import { SlashCommandClosure } from './SlashCommandClosure.js';
import { getEnumBooleanValues, getEnumIconByValueType } from './SlashCommandCommonEnumsProvider.js';
import { SlashCommandEnumValue } from './SlashCommandEnumValue.js';
import { SlashCommandExecutor } from './SlashCommandExecutor.js';
@ -72,7 +73,7 @@ export class SlashCommandArgument {
this.forceEnum = forceEnum;
// If no enums were set explictly and the type is one where we know possible enum values, we set them here
if (!this.enumList.length && types == ARGUMENT_TYPE.BOOLEAN) this.enumList = [new SlashCommandEnumValue('true'), new SlashCommandEnumValue('false')];
if (!this.enumList.length && types == ARGUMENT_TYPE.BOOLEAN) this.enumList = getEnumBooleanValues();
}
}