Add {{groupNotMuted}}
| @@ -2607,15 +2607,18 @@ export function substituteParams(content, _name1, _name2, _original, _group, _re | ||
| 2607 | 2607 | }; |
| 2608 | 2608 | } |
| 2609 | 2609 | |
| 2610 | 2610 | const getGroupValue = (includeMuted) => { |
| 2611 | 2611 | if (typeof _group === 'string') { |
| 2612 | 2612 | return _group; |
| 2613 | 2613 | } |
| 2614 | 2614 | |
| 2615 | 2615 | if (selected_group) { |
| 2616 | 2616 | const members = groups.find(x => x.id === selected_group)?.members; |
| 2617 | + /** @type {string[]} */ | |
| 2618 | + const disabledMembers = groups.find(x => x.id === selected_group)?.disabled_members ?? []; | |
| 2619 | + const isMuted = x => includeMuted ? true : !disabledMembers.includes(x); | |
| 2617 | 2620 | const names = Array.isArray(members) |
| 2618 | 2621 | ? members.filter(isMuted).map(m => characters.find(c => c.avatar === m)?.name).filter(Boolean).join(', ') |
| 2619 | 2622 | : ''; |
| 2620 | 2623 | return names; |
| 2621 | 2624 | } else { |
| @@ -2639,7 +2642,8 @@ export function substituteParams(content, _name1, _name2, _original, _group, _re | ||
| 2639 | 2642 | // Must be substituted last so that they're replaced inside {{description}} |
| 2640 | 2643 | environment.user = _name1 ?? name1; |
| 2641 | 2644 | environment.char = _name2 ?? name2; |
| 2642 | 2645 | environment.group = environment.charIfNotGroup = getGroupValue(true); |
| 2646 | + environment.groupNotMuted = getGroupValue(false); | |
| 2643 | 2647 | environment.model = getGeneratingModel(); |
| 2644 | 2648 | |
| 2645 | 2649 | if (additionalMacro && typeof additionalMacro === 'object') { |
| @@ -21,7 +21,8 @@ | ||
| 21 | 21 | <li><tt>{{user}}</tt> – <span data-i18n="help_macros_15">your current Persona username</span></li> |
| 22 | 22 | <li><tt>{{char}}</tt> – <span data-i18n="help_macros_16">the Character's name</span></li> |
| 23 | 23 | <li><tt>{{char_version}}</tt> – <span data-i18n="help_macros_17">the Character's version number</span></li> |
| 24 | 24 | <li><tt>{{group}}</tt> – <span data-i18n="help_macros_18">a comma-separated list of group member names (including muted) or the character name in solo chats. Alias: {{charIfNotGroup}}</span></li> |
| 25 | + <li><tt>{{groupNotMuted}}</tt> – <span data-i18n="help_groupNotMuted">the same as {{group}}, but excludes muted members</span></li> | |
| 25 | 26 | <li><tt>{{model}}</tt> – <span data-i18n="help_macros_19">a text generation model name for the currently selected API. </span><b data-i18n="Can be inaccurate!">Can be inaccurate!</b></li> |
| 26 | 27 | <li><tt>{{lastMessage}}</tt> – <span data-i18n="help_macros_20">the text of the latest chat message.</span></li> |
| 27 | 28 | <li><tt>{{lastUserMessage}}</tt> – <span data-i18n="help_macros_lastUser">the text of the latest user chat message.</span></li> |