Add argument to command

This commit is contained in:
Cal
2025-05-01 15:16:51 -06:00
parent 62b02bec3f
commit c677f0324a

View File

@ -315,6 +315,11 @@ export function initDefaultSlashCommands() {
typeList: [ARGUMENT_TYPE.NUMBER], typeList: [ARGUMENT_TYPE.NUMBER],
enumProvider: commonEnumProviders.messages({ allowIdAfter: true }), 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({ SlashCommandNamedArgument.fromProps({
name: 'return', name: 'return',
description: 'The way how you want the return value to be provided', 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) { export async function sendNarratorMessage(args, text) {
text = String(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 // Messages that do nothing but set bias will be hidden from the context
const bias = extractMessageBias(text); const bias = extractMessageBias(text);
const isSystem = bias && !removeMacros(text).length; const isSystem = bias && !removeMacros(text).length;