From c677f0324a3a3fa808c1bea02ecb48c85d31cfe6 Mon Sep 17 00:00:00 2001 From: Cal Date: Thu, 1 May 2025 15:16:51 -0600 Subject: [PATCH] Add argument to command --- public/scripts/slash-commands.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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;