mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add character filter to lastsprite
This commit is contained in:
@ -2051,7 +2051,7 @@ function migrateSettings() {
|
|||||||
const isCustom = extension_settings.expressions.custom?.includes(expression);
|
const isCustom = extension_settings.expressions.custom?.includes(expression);
|
||||||
return new SlashCommandEnumValue(expression, null, isCustom ? enumTypes.name : enumTypes.enum, isCustom ? 'C' : 'D');
|
return new SlashCommandEnumValue(expression, null, isCustom ? enumTypes.name : enumTypes.enum, isCustom ? 'C' : 'D');
|
||||||
}),
|
}),
|
||||||
}
|
};
|
||||||
|
|
||||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||||
name: 'sprite',
|
name: 'sprite',
|
||||||
@ -2088,7 +2088,7 @@ function migrateSettings() {
|
|||||||
description: 'character name',
|
description: 'character name',
|
||||||
typeList: [ARGUMENT_TYPE.STRING],
|
typeList: [ARGUMENT_TYPE.STRING],
|
||||||
isRequired: true,
|
isRequired: true,
|
||||||
enumProvider: commonEnumProviders.characters(),
|
enumProvider: commonEnumProviders.characters('character'),
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
helpString: 'Returns the last set sprite / expression for the named character.',
|
helpString: 'Returns the last set sprite / expression for the named character.',
|
||||||
|
@ -213,7 +213,7 @@ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
|||||||
name: 'at',
|
name: 'at',
|
||||||
description: 'position to insert the message',
|
description: 'position to insert the message',
|
||||||
typeList: [ARGUMENT_TYPE.NUMBER, ARGUMENT_TYPE.VARIABLE_NAME],
|
typeList: [ARGUMENT_TYPE.NUMBER, ARGUMENT_TYPE.VARIABLE_NAME],
|
||||||
enumProvider: commonEnumProviders.messages({ allowIdAfter: true, allowVars: true })
|
enumProvider: commonEnumProviders.messages({ allowIdAfter: true, allowVars: true }),
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
unnamedArgumentList: [
|
unnamedArgumentList: [
|
||||||
@ -267,7 +267,7 @@ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
|||||||
name: 'at',
|
name: 'at',
|
||||||
description: 'position to insert the message',
|
description: 'position to insert the message',
|
||||||
typeList: [ARGUMENT_TYPE.NUMBER, ARGUMENT_TYPE.VARIABLE_NAME],
|
typeList: [ARGUMENT_TYPE.NUMBER, ARGUMENT_TYPE.VARIABLE_NAME],
|
||||||
enumProvider: commonEnumProviders.messages({ allowIdAfter: true, allowVars: true })
|
enumProvider: commonEnumProviders.messages({ allowIdAfter: true, allowVars: true }),
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
unnamedArgumentList: [
|
unnamedArgumentList: [
|
||||||
@ -452,7 +452,7 @@ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
|||||||
name: 'at',
|
name: 'at',
|
||||||
description: 'position to insert the message',
|
description: 'position to insert the message',
|
||||||
typeList: [ARGUMENT_TYPE.NUMBER, ARGUMENT_TYPE.VARIABLE_NAME],
|
typeList: [ARGUMENT_TYPE.NUMBER, ARGUMENT_TYPE.VARIABLE_NAME],
|
||||||
enumProvider: commonEnumProviders.messages({ allowIdAfter: true, allowVars: true })
|
enumProvider: commonEnumProviders.messages({ allowIdAfter: true, allowVars: true }),
|
||||||
}),
|
}),
|
||||||
SlashCommandNamedArgument.fromProps({
|
SlashCommandNamedArgument.fromProps({
|
||||||
name: 'name',
|
name: 'name',
|
||||||
@ -461,7 +461,7 @@ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
|||||||
defaultValue: '{{user}}',
|
defaultValue: '{{user}}',
|
||||||
enumProvider: () => [
|
enumProvider: () => [
|
||||||
...commonEnumProviders.characters('character')(),
|
...commonEnumProviders.characters('character')(),
|
||||||
...commonEnumProviders.variables('all')().map(x => { x.description = 'Variable'; return x; })
|
...commonEnumProviders.variables('all')().map(x => { x.description = 'Variable'; return x; }),
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
@ -1302,7 +1302,7 @@ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
|||||||
...commonEnumProviders.injects(),
|
...commonEnumProviders.injects(),
|
||||||
...commonEnumProviders.variables('all')().map(x => { x.description = 'Variable'; return x; }),
|
...commonEnumProviders.variables('all')().map(x => { x.description = 'Variable'; return x; }),
|
||||||
],
|
],
|
||||||
})
|
}),
|
||||||
],
|
],
|
||||||
callback: flushInjectsCallback,
|
callback: flushInjectsCallback,
|
||||||
helpString: 'Removes a script injection for the current chat. If no ID is provided, removes all script injections.',
|
helpString: 'Removes a script injection for the current chat. If no ID is provided, removes all script injections.',
|
||||||
@ -1310,7 +1310,7 @@ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
|||||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||||
name: 'tokens',
|
name: 'tokens',
|
||||||
callback: (_, text) => {
|
callback: (_, text) => {
|
||||||
if (text instanceof SlashCommandClosure || Array.isArray(text)) throw new Error('Unnamed argument cannot be a closure for command /tokens')
|
if (text instanceof SlashCommandClosure || Array.isArray(text)) throw new Error('Unnamed argument cannot be a closure for command /tokens');
|
||||||
return getTokenCountAsync(text).then(count => String(count));
|
return getTokenCountAsync(text).then(count => String(count));
|
||||||
},
|
},
|
||||||
returns: 'number of tokens',
|
returns: 'number of tokens',
|
||||||
@ -1359,7 +1359,7 @@ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
|||||||
const promptManager = setupChatCompletionPromptManager(oai_settings);
|
const promptManager = setupChatCompletionPromptManager(oai_settings);
|
||||||
const prompts = promptManager.serviceSettings.prompts;
|
const prompts = promptManager.serviceSettings.prompts;
|
||||||
return prompts.map(prompt => new SlashCommandEnumValue(prompt.name, prompt.identifier, enumTypes.enum));
|
return prompts.map(prompt => new SlashCommandEnumValue(prompt.name, prompt.identifier, enumTypes.enum));
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
unnamedArgumentList: [
|
unnamedArgumentList: [
|
||||||
|
Reference in New Issue
Block a user