Add /classify-expressions to retrieve emote list

3b10ae00c7c6c2b801363a8f65251f936a062a88

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +11 -4Ignore whitespace
public/scripts/extensions/expressions/index.js+11 -4
@@ -1354,7 +1354,7 @@ function getCachedExpressions() {
1354 return [...expressionsList, ...extension_settings.expressions.custom].filter(onlyUnique);1354 return [...expressionsList, ...extension_settings.expressions.custom].filter(onlyUnique);
1355}1355}
13561356
1357async function getExpressionsList() {1357export async function getExpressionsList() {
1358 // Return cached list if available1358 // Return cached list if available
1359 if (Array.isArray(expressionsList)) {1359 if (Array.isArray(expressionsList)) {
1360 return getCachedExpressions();1360 return getCachedExpressions();
@@ -2085,7 +2085,7 @@ function migrateSettings() {
2085 }),2085 }),
2086 ],2086 ],
2087 helpString: 'Force sets the sprite for the current character.',2087 helpString: 'Force sets the sprite for the current character.',
2088 returns: 'label',2088 returns: 'the currently set sprite label after setting it.',
2089 }));2089 }));
2090 SlashCommandParser.addCommandObject(SlashCommand.fromProps({2090 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
2091 name: 'spriteoverride',2091 name: 'spriteoverride',
@@ -2101,7 +2101,7 @@ function migrateSettings() {
2101 SlashCommandParser.addCommandObject(SlashCommand.fromProps({2101 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
2102 name: 'lastsprite',2102 name: 'lastsprite',
2103 callback: (_, value) => lastExpression[String(value).trim()] ?? '',2103 callback: (_, value) => lastExpression[String(value).trim()] ?? '',
2104 returns: 'sprite',2104 returns: 'the last set sprite / expression for the named character.',
2105 unnamedArgumentList: [2105 unnamedArgumentList: [
2106 SlashCommandArgument.fromProps({2106 SlashCommandArgument.fromProps({
2107 description: 'character name',2107 description: 'character name',
@@ -2117,7 +2117,14 @@ function migrateSettings() {
2117 callback: toggleTalkingHeadCommand,2117 callback: toggleTalkingHeadCommand,
2118 aliases: ['talkinghead'],2118 aliases: ['talkinghead'],
2119 helpString: 'Character Expressions: toggles <i>Image Type - talkinghead (extras)</i> on/off.',2119 helpString: 'Character Expressions: toggles <i>Image Type - talkinghead (extras)</i> on/off.',
2120 returns: ARGUMENT_TYPE.BOOLEAN,2120 returns: 'the current state of the <i>Image Type - talkinghead (extras)</i> on/off.',
2121 }));
2122 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
2123 name: 'classify-expressions',
2124 aliases: ['expressions'],
2125 callback: async () => (await getExpressionsList()).join(', '),
2126 returns: 'The comma-separated list of available expressions, including custom expressions.',
2127 helpString: 'Returns a list of available expressions, including custom expressions.',
2121 }));2128 }));
2122 SlashCommandParser.addCommandObject(SlashCommand.fromProps({2129 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
2123 name: 'classify',2130 name: 'classify',