mirror of
https://github.com/SillyTavern/SillyTavern-Nicknames.git
synced 2026-10-15 18:11:57 +00:00
[PR #3] [MERGED] Expand Nickname Macro Coverage to Group Macros + Add Dedicated Nickname Macros #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/SillyTavern/SillyTavern-Nicknames/pull/3
Author: @Wolfsblvt
Created: 4/16/2026
Status: ✅ Merged
Merged: 4/16/2026
Merged by: @Wolfsblvt
Base:
main← Head:dev📝 Commits (5)
3d2b362Update all repo URLS to org6dbf6a3fix: Apply nicknames to group macros ({{group}}, {{groupNotMuted}}, {{notChar}})da16352feat: Add dedicated nickname macros and annotate affected core macrosea025f5fix: Update badge URLs to use SillyTavern org and bump version to 1.1.0f0dd1e5fix: macro group value calculation with context override📊 Changes
6 files changed (+169 additions, -22 deletions)
View changed files
📝
README.md(+18 -5)📝
index.js(+2 -2)📝
manifest.json(+2 -2)📝
src/macros.js(+138 -8)📝
src/ui.js(+5 -1)📝
templates/settings.html(+4 -4)📄 Description
This PR extends the Nicknames extension's macro integration to fully cover group-related macros, and introduces four new dedicated nickname macros that give users explicit control over when nicknames are used. Version bumped to 1.1.0.
What Changed
{{group}},{{groupNotMuted}}, and{{notChar}}now resolve each group member's name through the nickname system when "Macros & Prompts" override is enabledMacroRegistry:{{userFull}}/{{charFull}}— always return the original name, bypassing all nickname settings{{userNickname}}/{{charNickname}}— return the nickname if one is set, otherwise fall back to the original nameuser,char,group,groupNotMuted,notChar) get a ``Using nicknames when available]` note appended to their description in the macro browser; this is restored when the setting is toggled off{{user}}/{{char}}Why These Changes
Previously, enabling "Macros & Prompts" mode would replace
{{user}}and{{char}}with nicknames, but the group macros ({{group}},{{groupNotMuted}},{{notChar}}) still returned original character names. This created an inconsistency in group chats where some names would be nicknames and others wouldn't.The dedicated
{{userNickname}}/{{charNickname}}macros address a different need: users who want the nickname in specific places (e.g. a system prompt) without enabling the global override that affects all macro resolution. Conversely,{{userFull}}/{{charFull}}let users hard-code a reference to the original name even when the global override is on.How It Works
Group macro recalculation is handled by a new [getGroupValue()
helper that mirrors the logic in ST's coreMacroEnvBuilder, but runs each member's name throughgetNicknameForCharAvatar()` before building the comma-separated output. This runs inside the existing env provider, so it integrates cleanly without touching core code.The new dedicated macros are registered through
MacroRegistry.registerMacro()into theNAMEScategory, making them discoverable in the macro browser alongside the core macros they complement.Description annotations are managed by
syncCoreMacroDescriptions(), which is called both on init and whenever the "use for macros" setting is toggled — ensuring the macro browser always reflects the current state accurately.Impact
{{charNickname}}without flipping the global override, or use{{charFull}}to pin an original name even when the override is on🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.