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() {
13541354 return [...expressionsList, ...extension_settings.expressions.custom].filter(onlyUnique);
13551355}
13561356
13571357export async function getExpressionsList() {
13581358 // Return cached list if available
13591359 if (Array.isArray(expressionsList)) {
13601360 return getCachedExpressions();
@@ -2085,7 +2085,7 @@ function migrateSettings() {
20852085 }),
20862086 ],
20872087 helpString: 'Force sets the sprite for the current character.',
20882088 returns: 'the currently set sprite label after setting it.',
20892089 }));
20902090 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
20912091 name: 'spriteoverride',
@@ -2101,7 +2101,7 @@ function migrateSettings() {
21012101 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
21022102 name: 'lastsprite',
21032103 callback: (_, value) => lastExpression[String(value).trim()] ?? '',
2104- returns: 'sprite',
2104+ returns: 'the last set sprite / expression for the named character.',
21052105 unnamedArgumentList: [
21062106 SlashCommandArgument.fromProps({
21072107 description: 'character name',
@@ -2117,7 +2117,14 @@ function migrateSettings() {
21172117 callback: toggleTalkingHeadCommand,
21182118 aliases: ['talkinghead'],
21192119 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.',
21212128 }));
21222129 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
21232130 name: 'classify',