Groups: add 'manual' reply strategy

99220d6a8898c876943ee13e1032d544eff40e37

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +5 -0Ignore whitespace
public/index.html+1 -0
@@ -5055,6 +5055,7 @@
5055 <span data-i18n="Group reply strategy">Group reply strategy</span>5055 <span data-i18n="Group reply strategy">Group reply strategy</span>
5056 </label>5056 </label>
5057 <select id="rm_group_activation_strategy">5057 <select id="rm_group_activation_strategy">
5058 <option value="2" data-i18n="Manual">Manual</option>
5058 <option value="0" data-i18n="Natural order">Natural order</option>5059 <option value="0" data-i18n="Natural order">Natural order</option>
5059 <option value="1" data-i18n="List order">List order</option>5060 <option value="1" data-i18n="List order">List order</option>
5060 </select>5061 </select>
public/scripts/group-chats.js+4 -0
@@ -110,6 +110,7 @@ let newGroupMembers = [];
110export const group_activation_strategy = {110export const group_activation_strategy = {
111 NATURAL: 0,111 NATURAL: 0,
112 LIST: 1,112 LIST: 1,
113 MANUAL: 2,
113};114};
114115
115export const group_generation_mode = {116export const group_generation_mode = {
@@ -852,6 +853,9 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) {
852 else if (activationStrategy === group_activation_strategy.LIST) {853 else if (activationStrategy === group_activation_strategy.LIST) {
853 activatedMembers = activateListOrder(enabledMembers);854 activatedMembers = activateListOrder(enabledMembers);
854 }855 }
856 else if (activationStrategy === group_activation_strategy.MANUAL && !isUserInput) {
857 activatedMembers = shuffle(enabledMembers).slice(0, 1).map(x => characters.findIndex(y => y.avatar === x)).filter(x => x !== -1);
858 }
855859
856 if (activatedMembers.length === 0) {860 if (activatedMembers.length === 0) {
857 //toastr.warning('All group members are disabled. Enable at least one to get a reply.');861 //toastr.warning('All group members are disabled. Enable at least one to get a reply.');