Group reply mode (placeholder)

This commit is contained in:
SillyLossy
2023-04-06 00:02:56 +03:00
parent 8548d4ca47
commit 60d64bb67e
3 changed files with 85 additions and 0 deletions

View File

@@ -1169,6 +1169,18 @@
<input id="rm_group_automode" type="checkbox" /> <input id="rm_group_automode" type="checkbox" />
Auto Mode Auto Mode
</label> </label>
<h5>
Group reply strategy
<a href="/notes/group_reply_strategy" class="notes-link" target="_blank"><span class="note-link-span">?</span></a>
</h5>
<label>
<input type="radio" name="rm_group_activation_strategy" value="0" />
Natural order
</label>
<label>
<input type="radio" name="rm_group_activation_strategy" value="1" />
List order
</label>
</div> </div>
<div id="rm_group_buttons_expander">&nbsp;</div> <div id="rm_group_buttons_expander">&nbsp;</div>
<input id="rm_group_submit" class="menu_button" type="submit" value="Create"> <input id="rm_group_submit" class="menu_button" type="submit" value="Create">

View File

@@ -0,0 +1,64 @@
<html>
<head>
<title>Advanced Formatting</title>
<link rel="stylesheet" href="/css/notes.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
<link
href="https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&amp;display=swap"
rel="stylesheet">
</head>
<body>
<div id="main">
<div id="content">
<h2>Group reply order strategies</h2>
<p>
Decides how characters in group chats are drafted for their replies.
</p>
<h3>Natural order</h3>
<p>
Tries to simulate the flow of a real human conversation. The algorithm is as follows:
</p>
<h4>1. Mentions of the group member names are extracted from the last message in chat.</h4>
<p>
Only whole words are recognized as mentions!
If your character's name is "Misaka Mikoto", they will reply only activate on "Misaka" or "Mikoto", but
never to "Misa", "Railgun", etc.
</p>
<p>
Unless "Allow bot responses to self" setting is enabled, characters won't reply to mentions of their
name in their own message!
</p>
<h4>2. Characters are activated by the "Talkativeness" factor.</h4>
<p>
Talkativeness defines how often the character speaks if it was not mentioned. Adjust this value on
"Advanced definitions" screen in character editor.
Slider values are on a linear scale from <b>0% / Shy</b> (character never talks unless mentioned) to
<b>100% / Chatty</b> (character always replies).
Default value for new characters is 50% chance.
</p>
<h4>3. Random character is selected.</h4>
<p>
If no characters were activated at previous steps, one speaker is selected randomly, ignoring all other
conditions.
</p>
<h3>List order</h3>
<p>
Characters are drafted based on the order they are presented in group members list. No other rules
apply.
</p>
<h3>Important!</h3>
<br>
<strong style="color: salmon">
Regeneration in group chats deletes all character message up until the <i>last message sent by you</i>.
Use swipes to generate just the latest message.
</strong>
</div>
</div>
</body>
</html>

View File

@@ -519,6 +519,15 @@ function select_group_chats(chat_id) {
}); });
$("#rm_group_filter").val("").trigger("input"); $("#rm_group_filter").val("").trigger("input");
$('input[name="rm_group_activation_strategy"]').off();
$('input[name="rm_group_activation_strategy"]').on("input", async function(e) {
if (chat_id) {
group.activation_strategy = Number(e.target.value);
await editGroup(chat_id);
}
});
$(`input[name="rm_group_activation_strategy"][value="${Number(group?.activation_strategy ?? 0 )}"]`).prop('checked', true);
selectRightMenuWithAnimation('rm_group_chats_block'); selectRightMenuWithAnimation('rm_group_chats_block');
async function memberClickHandler(event) { async function memberClickHandler(event) {