Switch /input command definition to fromProps

This commit is contained in:
Wolfsblvt
2025-03-09 22:29:40 +01:00
parent 070de9df2d
commit fa03443fe7

View File

@ -1287,26 +1287,42 @@ export function initDefaultSlashCommands() {
callback: inputCallback, callback: inputCallback,
returns: 'user input', returns: 'user input',
namedArgumentList: [ namedArgumentList: [
new SlashCommandNamedArgument( SlashCommandNamedArgument.fromProps({
'default', 'default value of the input field', [ARGUMENT_TYPE.STRING], false, false, '"string"', name: 'default',
), description: 'default value of the input field',
new SlashCommandNamedArgument( typeList: [ARGUMENT_TYPE.STRING],
'large', 'show large input field', [ARGUMENT_TYPE.BOOLEAN], false, false, 'off', commonEnumProviders.boolean('onOff')(), }),
), SlashCommandNamedArgument.fromProps({
new SlashCommandNamedArgument( name: 'large',
'wide', 'show wide input field', [ARGUMENT_TYPE.BOOLEAN], false, false, 'off', commonEnumProviders.boolean('onOff')(), description: 'show large input field',
), typeList: [ARGUMENT_TYPE.BOOLEAN],
new SlashCommandNamedArgument( defaultValue: 'off',
'okButton', 'text for the ok button', [ARGUMENT_TYPE.STRING], false, enumList: commonEnumProviders.boolean('onOff')(),
), }),
new SlashCommandNamedArgument( SlashCommandNamedArgument.fromProps({
'rows', 'number of rows for the input field', [ARGUMENT_TYPE.NUMBER], false, name: 'wide',
), description: 'show wide input field',
typeList: [ARGUMENT_TYPE.BOOLEAN],
defaultValue: 'off',
enumList: commonEnumProviders.boolean('onOff')(),
}),
SlashCommandNamedArgument.fromProps({
name: 'okButton',
description: 'text for the ok button',
typeList: [ARGUMENT_TYPE.STRING],
defaultValue: 'Ok',
}),
SlashCommandNamedArgument.fromProps({
name: 'rows',
description: 'number of rows for the input field',
typeList: [ARGUMENT_TYPE.NUMBER],
}),
], ],
unnamedArgumentList: [ unnamedArgumentList: [
new SlashCommandArgument( SlashCommandArgument.fromProps({
'text to display', [ARGUMENT_TYPE.STRING], false, description: 'text to display',
), typeList: [ARGUMENT_TYPE.STRING],
}),
], ],
helpString: ` helpString: `
<div> <div>