Introduce new substitute parameters

charIfNotGroup and group
This commit is contained in:
maver 2023-06-06 18:03:30 +02:00
parent 121bbf19d6
commit 3acd865bf8

View File

@ -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());