Refactor /if to fromProps

This commit is contained in:
Wolfsblvt
2024-09-22 02:32:43 +02:00
parent 1bc0630595
commit a1af768b02

View File

@ -1274,8 +1274,12 @@ export function registerVariableCommands() {
enumProvider: commonEnumProviders.variables('all'), enumProvider: commonEnumProviders.variables('all'),
forceEnum: false, forceEnum: false,
}), }),
new SlashCommandNamedArgument( SlashCommandNamedArgument.fromProps({
'rule', 'comparison rule', [ARGUMENT_TYPE.STRING], true, false, null, [ name: 'rule',
description: 'comparison rule',
typeList: [ARGUMENT_TYPE.STRING],
isRequired: true,
enumList: [
new SlashCommandEnumValue('gt', 'a > b'), new SlashCommandEnumValue('gt', 'a > b'),
new SlashCommandEnumValue('gte', 'a >= b'), new SlashCommandEnumValue('gte', 'a >= b'),
new SlashCommandEnumValue('lt', 'a < b'), new SlashCommandEnumValue('lt', 'a < b'),
@ -1286,10 +1290,13 @@ export function registerVariableCommands() {
new SlashCommandEnumValue('in', 'a includes b'), new SlashCommandEnumValue('in', 'a includes b'),
new SlashCommandEnumValue('nin', 'a not includes b'), new SlashCommandEnumValue('nin', 'a not includes b'),
], ],
), }),
new SlashCommandNamedArgument( SlashCommandNamedArgument.fromProps({
'else', 'command to execute if not true', [ARGUMENT_TYPE.CLOSURE, ARGUMENT_TYPE.SUBCOMMAND], false, name: 'else',
), description: 'command to execute if not true',
typeList: [ARGUMENT_TYPE.CLOSURE, ARGUMENT_TYPE.SUBCOMMAND],
isRequired: false,
}),
], ],
unnamedArgumentList: [ unnamedArgumentList: [
new SlashCommandArgument( new SlashCommandArgument(