Fix type errors in command registration

This commit is contained in:
Cohee
2024-12-22 18:12:07 +02:00
parent c3a12cc1a2
commit 0f93caa427

View File

@@ -2281,9 +2281,9 @@ function migrateSettings() {
})); }));
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'uploadsprite', name: 'uploadsprite',
description: 'Upload a sprite',
callback: async (args, url) => { callback: async (args, url) => {
await uploadSpriteCommand(args, url); await uploadSpriteCommand(args, url);
return '';
}, },
unnamedArgumentList: [ unnamedArgumentList: [
SlashCommandArgument.fromProps({ SlashCommandArgument.fromProps({
@@ -2296,19 +2296,26 @@ function migrateSettings() {
SlashCommandNamedArgument.fromProps({ SlashCommandNamedArgument.fromProps({
name: 'name', name: 'name',
description: 'Character name or avatar key (default is current character)', description: 'Character name or avatar key (default is current character)',
type: ARGUMENT_TYPE.STRING, typeList: [ARGUMENT_TYPE.STRING],
isRequired: false,
acceptsMultiple: false,
}), }),
SlashCommandNamedArgument.fromProps({ SlashCommandNamedArgument.fromProps({
name: 'label', name: 'label',
description: 'Sprite label/expression name', description: 'Sprite label/expression name',
type: ARGUMENT_TYPE.STRING, typeList: [ARGUMENT_TYPE.STRING],
enumProvider: localEnumProviders.expressions,
isRequired: true,
acceptsMultiple: false,
}), }),
SlashCommandNamedArgument.fromProps({ SlashCommandNamedArgument.fromProps({
name: 'folder', name: 'folder',
description: 'Override folder to upload into', description: 'Override folder to upload into',
type: ARGUMENT_TYPE.STRING, typeList: [ARGUMENT_TYPE.STRING],
isRequired: false,
acceptsMultiple: false,
}), }),
], ],
helpString: 'Upload a sprite from a URL. Example: /uploadsprite name=Seraphina label=happy /user/images/Seraphina/Seraphina_2024-12-22@12h37m57s.png', helpString: '<div>Upload a sprite from a URL.</div><div>Example:</div><pre><code>/uploadsprite name=Seraphina label=joy /user/images/Seraphina/Seraphina_2024-12-22@12h37m57s.png</code></pre>',
})); }));
})(); })();