Merge pull request #3946 from InspectorCaracal/add-sys-name

Add a named argument of "name" to the `/sys` slash command
This commit is contained in:
Cohee
2025-05-02 00:58:37 +03:00
committed by GitHub

View File

@@ -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;