mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-20 13:38:49 +01:00
Introduce new substitute parameters
charIfNotGroup and group
This commit is contained in:
parent
121bbf19d6
commit
3acd865bf8
@ -1632,9 +1632,11 @@ function scrollChatToBottom() {
|
||||
}
|
||||
}
|
||||
|
||||
function substituteParams(content, _name1, _name2, _original) {
|
||||
function substituteParams(content, _name1, _name2, _original, _group) {
|
||||
_name1 = _name1 ?? name1;
|
||||
_name2 = _name2 ?? name2;
|
||||
_original = _original || '';
|
||||
_group = _group ?? name2;
|
||||
|
||||
if (!content) {
|
||||
return '';
|
||||
@ -1649,8 +1651,14 @@ function substituteParams(content, _name1, _name2, _original) {
|
||||
content = content.replace(/{{input}}/gi, $('#send_textarea').val());
|
||||
content = content.replace(/{{user}}/gi, _name1);
|
||||
content = content.replace(/{{char}}/gi, _name2);
|
||||
content = content.replace(/{{charIfNotGroup}}/gi, _group);
|
||||
content = content.replace(/{{group}}/gi, _group);
|
||||
|
||||
content = content.replace(/<USER>/gi, _name1);
|
||||
content = content.replace(/<BOT>/gi, _name2);
|
||||
content = content.replace(/<CHARIFNOTGROUP>/gi, _group);
|
||||
content = content.replace(/<GROUP>/gi, _group);
|
||||
|
||||
content = content.replace(/{{time}}/gi, moment().format('LT'));
|
||||
content = content.replace(/{{date}}/gi, moment().format('LL'));
|
||||
content = content.replace(/{{idle_duration}}/gi, () => getTimeSinceLastMessage());
|
||||
|
Loading…
Reference in New Issue
Block a user