diff --git a/public/scripts/authors-note.js b/public/scripts/authors-note.js index 6d0aedfb3..12efed7eb 100644 --- a/public/scripts/authors-note.js +++ b/public/scripts/authors-note.js @@ -17,6 +17,7 @@ import { SlashCommand } from './slash-commands/SlashCommand.js'; import { ARGUMENT_TYPE, SlashCommandArgument } from './slash-commands/SlashCommandArgument.js'; export { MODULE_NAME as NOTE_MODULE_NAME }; import { t } from './i18n.js'; +import { MacrosParser } from './macros.js'; const MODULE_NAME = '2_floating_prompt'; // <= Deliberate, for sorting lower than memory @@ -576,4 +577,8 @@ export function initAuthorsNote() { `, })); eventSource.on(event_types.CHAT_CHANGED, onChatChanged); + + MacrosParser.registerMacro('authorsNote', () => chat_metadata[metadata_keys.prompt] ?? '', t`The contents of the Author's Note`); + MacrosParser.registerMacro('charAuthorsNote', () => this_chid !== undefined ? (extension_settings.note.chara.find((e) => e.name === getCharaFilename())?.prompt ?? '') : '', t`The contents of the Character Author's Note`); + MacrosParser.registerMacro('defaultAuthorsNote', () => extension_settings.note.default ?? '', t`The contents of the Default Author's Note`); }