diff --git a/public/scripts/personas.js b/public/scripts/personas.js index 1e50dddc4..a7d1e2b96 100644 --- a/public/scripts/personas.js +++ b/public/scripts/personas.js @@ -1897,6 +1897,7 @@ function syncCallback() { function registerPersonaSlashCommands() { SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'persona-lock', + aliases: ['lock', 'bind'], callback: lockPersonaCallback, returns: 'The current lock state for the given type', helpString: 'Locks/unlocks a persona (name and avatar) to the current chat. Gets the current lock state for the given type if no state is provided.', @@ -1921,43 +1922,6 @@ function registerPersonaSlashCommands() { }), ], })); - // TODO: Legacy command. Might be removed in the future and replaced by /persona-lock with aliases. - SlashCommandParser.addCommandObject(SlashCommand.fromProps({ - name: 'lock', - /** @type {(args: { type: string }, value: string) => Promise} */ - callback: (args, value) => { - if (!value) { - value = 'toggle'; - toastr.warning(t`Using /lock without a provided state to toggle the persona is deprecated. Please use /persona-lock instead. - In the future this command with no state provided will return the current state, instead of toggling it.`, t`Deprecation Warning`); - } - return lockPersonaCallback(args, value); - }, - returns: 'The current lock state for the given type', - aliases: ['bind'], - helpString: 'Locks/unlocks a persona (name and avatar) to the current chat. Gets the current lock state for the given type if no state is provided.', - namedArgumentList: [ - SlashCommandNamedArgument.fromProps({ - name: 'type', - description: 'The type of the lock, where it should apply to', - typeList: [ARGUMENT_TYPE.STRING], - defaultValue: 'chat', - enumList: [ - new SlashCommandEnumValue('chat', 'Lock the persona to the current chat.'), - new SlashCommandEnumValue('character', 'Lock this persona to the currently selected character. If the setting is enabled, multiple personas can be locked to the same character.'), - new SlashCommandEnumValue('default', 'Lock this persona as the default persona for all new chats.'), - ], - }), - ], - unnamedArgumentList: [ - SlashCommandArgument.fromProps({ - description: 'state', - typeList: [ARGUMENT_TYPE.STRING], - defaultValue: 'toggle', - enumProvider: commonEnumProviders.boolean('onOffToggle'), - }), - ], - })); SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'persona-set', callback: setNameCallback, diff --git a/public/scripts/slash-commands.js b/public/scripts/slash-commands.js index 3de5ff0c8..51d7bfa63 100644 --- a/public/scripts/slash-commands.js +++ b/public/scripts/slash-commands.js @@ -2939,19 +2939,6 @@ export function initDefaultSlashCommands() { enumList: slashCommandReturnHelper.enumList({ allowPipe: false, allowObject: true, allowChat: true, allowPopup: true, allowTextVersion: false }), forceEnum: true, }), - // TODO remove some day - SlashCommandNamedArgument.fromProps({ - name: 'format', - description: t`!!! DEPRECATED - use "return" instead !!! output format`, - typeList: [ARGUMENT_TYPE.STRING], - isRequired: true, - forceEnum: true, - enumList: [ - new SlashCommandEnumValue('popup', t`Show injects in a popup.`, enumTypes.enum, enumIcons.default), - new SlashCommandEnumValue('chat', t`Post a system message to the chat.`, enumTypes.enum, enumIcons.default), - new SlashCommandEnumValue('none', t`Just return the injects as a JSON object.`, enumTypes.enum, enumIcons.default), - ], - }), ], })); SlashCommandParser.addCommandObject(SlashCommand.fromProps({ @@ -3810,27 +3797,6 @@ async function listInjectsCallback(args) { /** @type {import('./slash-commands/SlashCommandReturnHelper.js').SlashCommandReturnType} */ let returnType = args.return; - // Old legacy return type handling - if (args.format) { - toastr.warning(t`Legacy argument 'format' with value '${args.format}' is deprecated. Please use 'return' instead. Routing to the correct return type...`, t`Deprecation warning`); - const type = String(args?.format).toLowerCase().trim(); - if (!chat_metadata.script_injects || !Object.keys(chat_metadata.script_injects).length) { - type !== 'none' && toastr.info(t`No script injections for the current chat`); - } - switch (type) { - case 'none': - returnType = 'none'; - break; - case 'chat': - returnType = 'chat-html'; - break; - case 'popup': - default: - returnType = 'popup-html'; - break; - } - } - // Now the actual new return type handling const buildTextValue = (injects) => { const injectsStr = Object.entries(injects) diff --git a/public/scripts/variables.js b/public/scripts/variables.js index 7cd3c9660..7e5f7d092 100644 --- a/public/scripts/variables.js +++ b/public/scripts/variables.js @@ -264,24 +264,6 @@ async function listVariablesCallback(args) { /** @type {import('./slash-commands/SlashCommandReturnHelper.js').SlashCommandReturnType} */ let returnType = args.return; - // Old legacy return type handling - if (args.format) { - toastr.warning(`Legacy argument 'format' with value '${args.format}' is deprecated. Please use 'return' instead. Routing to the correct return type...`, 'Deprecation warning'); - const type = String(args?.format).toLowerCase().trim(); - switch (type) { - case 'none': - returnType = 'none'; - break; - case 'chat': - returnType = 'chat-html'; - break; - case 'popup': - default: - returnType = 'popup-html'; - break; - } - } - // Now the actual new return type handling const scope = String(args?.scope || '').toLowerCase().trim() || 'all'; if (!chat_metadata.variables) { @@ -946,19 +928,6 @@ export function registerVariableCommands() { enumList: slashCommandReturnHelper.enumList({ allowPipe: false, allowObject: true, allowChat: true, allowPopup: true, allowTextVersion: false }), forceEnum: true, }), - // TODO remove some day - SlashCommandNamedArgument.fromProps({ - name: 'format', - description: '!!! DEPRECATED - use "return" instead !!! output format', - typeList: [ARGUMENT_TYPE.STRING], - isRequired: true, - forceEnum: true, - enumList: [ - new SlashCommandEnumValue('popup', 'Show variables in a popup.', enumTypes.enum, enumIcons.default), - new SlashCommandEnumValue('chat', 'Post a system message to the chat.', enumTypes.enum, enumIcons.message), - new SlashCommandEnumValue('none', 'Just return the variables as a JSON list.', enumTypes.enum, enumIcons.array), - ], - }), ], })); SlashCommandParser.addCommandObject(SlashCommand.fromProps({