Summary plugin improvements: In-chat position, customizable template, force insert after X words

This commit is contained in:
Cohee
2023-07-30 23:10:37 +03:00
parent 02667d3d1a
commit 40f466b2c3
5 changed files with 139 additions and 69 deletions

View File

@@ -5,6 +5,7 @@ import {
delay,
isDataURL,
createThumbnail,
extractAllWords,
} from './utils.js';
import { RA_CountCharTokens, humanizedDateTime, dragElement } from "./RossAscends-mods.js";
import { sortCharactersList, sortGroupMembers, loadMovingUIState } from './power-user.js';
@@ -782,19 +783,6 @@ function activateNaturalOrder(members, input, lastMessage, allowSelfResponses, i
return memberIds;
}
function extractAllWords(value) {
const words = [];
if (!value) {
return words;
}
const matches = value.matchAll(/\b\w+\b/gim);
for (let match of matches) {
words.push(match[0].toLowerCase());
}
return words;
}
async function deleteGroup(id) {