mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Refactor /if to fromProps
This commit is contained in:
@ -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(
|
||||||
|
Reference in New Issue
Block a user