diff --git a/public/scripts/slash-commands.js b/public/scripts/slash-commands.js index 66555216c..8ea913160 100644 --- a/public/scripts/slash-commands.js +++ b/public/scripts/slash-commands.js @@ -315,6 +315,11 @@ export function initDefaultSlashCommands() { typeList: [ARGUMENT_TYPE.NUMBER], enumProvider: commonEnumProviders.messages({ allowIdAfter: true }), }), + SlashCommandNamedArgument.fromProps({ + name: 'name', + description: 'Optional custom display name to use for this system narrator message.', + typeList: [ARGUMENT_TYPE.STRING], + }), SlashCommandNamedArgument.fromProps({ name: 'return', description: 'The way how you want the return value to be provided', @@ -3851,7 +3856,7 @@ export async function sendMessageAs(args, text) { export async function sendNarratorMessage(args, text) { text = String(text ?? ''); - const name = chat_metadata[NARRATOR_NAME_KEY] || NARRATOR_NAME_DEFAULT; + const name = args.name ?? (chat_metadata[NARRATOR_NAME_KEY] || NARRATOR_NAME_DEFAULT); // Messages that do nothing but set bias will be hidden from the context const bias = extractMessageBias(text); const isSystem = bias && !removeMacros(text).length;