| 585 | } | 587 | } |
| 586 | | 588 | |
| 587 | function registerAuthorsNoteMacros() { | 589 | function registerAuthorsNoteMacros() { |
| 588 | macros.register('authorsNote', { | 590 | if (power_user.experimental_macro_engine) { |
| 589 | category: MacroCategory.PROMPTS, | 591 | macros.register('authorsNote', { |
| 590 | description: t`The contents of the Author's Note`, | 592 | category: MacroCategory.PROMPTS, |
| 591 | handler: () => chat_metadata[metadata_keys.prompt] ?? '', | 593 | description: t`The contents of the Author's Note`, |
| 592 | }); | 594 | handler: () => chat_metadata[metadata_keys.prompt] ?? '', |
| 593 | macros.register('charAuthorsNote', { | 595 | }); |
| 594 | category: MacroCategory.CHARACTER, | 596 | macros.register('charAuthorsNote', { |
| 595 | description: t`The contents of the Character Author's Note`, | 597 | category: MacroCategory.CHARACTER, |
| 596 | handler: () => this_chid !== undefined ? (extension_settings.note.chara.find((e) => e.name === getCharaFilename())?.prompt ?? '') : '', | 598 | description: t`The contents of the Character Author's Note`, |
| 597 | }); | 599 | handler: () => this_chid !== undefined ? (extension_settings.note.chara.find((e) => e.name === getCharaFilename())?.prompt ?? '') : '', |
| 598 | macros.register('defaultAuthorsNote', { | 600 | }); |
| 599 | category: MacroCategory.PROMPTS, | 601 | macros.register('defaultAuthorsNote', { |
| 600 | description: t`The contents of the Default Author's Note`, | 602 | category: MacroCategory.PROMPTS, |
| 601 | handler: () => extension_settings.note.default ?? '', | 603 | description: t`The contents of the Default Author's Note`, |
| 602 | }); | 604 | handler: () => extension_settings.note.default ?? '', |
| | 605 | }); |
| | 606 | } else { |
| | 607 | // TODO: Remove this when the experimental macro engine is replacing the old macro engine |
| | 608 | MacrosParser.registerMacro('authorsNote', |
| | 609 | () => chat_metadata[metadata_keys.prompt] ?? '', |
| | 610 | t`The contents of the Author's Note`, |
| | 611 | ); |
| | 612 | MacrosParser.registerMacro('charAuthorsNote', |
| | 613 | () => this_chid !== undefined ? (extension_settings.note.chara.find((e) => e.name === getCharaFilename())?.prompt ?? '') : '', |
| | 614 | t`The contents of the Character Author's Note`, |
| | 615 | ); |
| | 616 | MacrosParser.registerMacro('defaultAuthorsNote', |
| | 617 | () => extension_settings.note.default ?? '', |
| | 618 | t`The contents of the Default Author's Note`, |
| | 619 | ); |
| | 620 | } |
| 603 | } | 621 | } |
| 604 | | | |