mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	Update more commands for new char find
- Update /member-add to utilize new char find functionality - Update /tag-add, /tag-remove, /tag-exists and /tag-list to utilize new char find functionality . Update /lastsprite to utilize new char find functionality
This commit is contained in:
		@@ -12,6 +12,7 @@ import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from '
 | 
			
		||||
import { isFunctionCallingSupported } from '../../openai.js';
 | 
			
		||||
import { SlashCommandEnumValue, enumTypes } from '../../slash-commands/SlashCommandEnumValue.js';
 | 
			
		||||
import { commonEnumProviders } from '../../slash-commands/SlashCommandCommonEnumsProvider.js';
 | 
			
		||||
import { findChar } from '../../slash-commands.js';
 | 
			
		||||
export { MODULE_NAME };
 | 
			
		||||
 | 
			
		||||
const MODULE_NAME = 'expressions';
 | 
			
		||||
@@ -2105,14 +2106,20 @@ function migrateSettings() {
 | 
			
		||||
    }));
 | 
			
		||||
    SlashCommandParser.addCommandObject(SlashCommand.fromProps({
 | 
			
		||||
        name: 'lastsprite',
 | 
			
		||||
        callback: (_, value) => lastExpression[String(value).trim()] ?? '',
 | 
			
		||||
        callback: (_, name) => {
 | 
			
		||||
            if (typeof name !== 'string') throw new Error('name must be a string');
 | 
			
		||||
            const char = findChar({ name: name });
 | 
			
		||||
            const sprite = lastExpression[char?.name ?? name] ?? '';
 | 
			
		||||
            return sprite;
 | 
			
		||||
        },
 | 
			
		||||
        returns: 'the last set sprite / expression for the named character.',
 | 
			
		||||
        unnamedArgumentList: [
 | 
			
		||||
            SlashCommandArgument.fromProps({
 | 
			
		||||
                description: 'character name',
 | 
			
		||||
                description: 'Character name - or unique character identifier (avatar key)',
 | 
			
		||||
                typeList: [ARGUMENT_TYPE.STRING],
 | 
			
		||||
                isRequired: true,
 | 
			
		||||
                enumProvider: commonEnumProviders.characters('character'),
 | 
			
		||||
                forceEnum: true,
 | 
			
		||||
            }),
 | 
			
		||||
        ],
 | 
			
		||||
        helpString: 'Returns the last set sprite / expression for the named character.',
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user