diff --git a/public/scripts/extensions/expressions/index.js b/public/scripts/extensions/expressions/index.js index 70bf300f3..3ef1ecf8f 100644 --- a/public/scripts/extensions/expressions/index.js +++ b/public/scripts/extensions/expressions/index.js @@ -792,6 +792,8 @@ async function setSpriteSlashCommand({ type }, searchTerm) { function setFallBackExpressionSlashCommand(args, expressionName) { expressionName = expressionName.trim().toLowerCase(); + if (!expressionName) return extension_settings?.expressions?.fallback_expression || ''; + const select = /** @type {HTMLSelectElement} */(document.getElementById('expression_fallback')); const fallbackExpressions = Array .from(select?.options || []) @@ -2341,13 +2343,13 @@ export async function init() { returns: 'The currently set expression label after setting it.', })); SlashCommandParser.addCommandObject(SlashCommand.fromProps({ - name: 'expression-set-fallback', + name: 'expression-fallback', callback: setFallBackExpressionSlashCommand, unnamedArgumentList: [ SlashCommandArgument.fromProps({ description: 'expression label to set', typeList: [ARGUMENT_TYPE.STRING], - isRequired: true, + isRequired: false, enumProvider: () => [ new SlashCommandEnumValue('#none', 'Sets the fallback expression to no image'), new SlashCommandEnumValue('#emoji', 'Sets the fallback expression to emojis'), @@ -2355,7 +2357,25 @@ export async function init() { ], }), ], - helpString: 'Force sets the expression fallback for all characters.', + helpString: ` +
+ Gets the currently selected expression fallback for all characters.
+ If a valid expression label is sent, it will be set as the new fallback. +
+
+ Example: + +
+ `, returns: 'The currently set expression label after setting it.', })); SlashCommandParser.addCommandObject(SlashCommand.fromProps({