Move CFG to top level for shorter access, add hacky jsdoc typedef

This commit is contained in:
DominikDoom
2025-07-10 18:22:18 +02:00
parent bdbda299f7
commit 8eb5176ab4
12 changed files with 218 additions and 169 deletions

View File

@@ -1,5 +1,5 @@
const LYCO_REGEX = /<(?!e:|h:|c:)[^,> ]*>?/g;
const LYCO_TRIGGER = () => TAC.Globals.CFG.useLycos && TAC.Globals.tagword.match(LYCO_REGEX);
const LYCO_TRIGGER = () => TAC.CFG.useLycos && TAC.Globals.tagword.match(LYCO_REGEX);
class LycoParser extends BaseTagParser {
parse() {
@@ -49,13 +49,13 @@ async function load() {
async function sanitize(tagType, text) {
if (tagType === ResultType.lyco) {
let multiplier = TAC.Globals.CFG.extraNetworksDefaultMultiplier;
let multiplier = TAC.CFG.extraNetworksDefaultMultiplier;
let info = await TacUtils.fetchAPI(`tacapi/v1/lyco-info/${text}`)
if (info && info["preferred weight"]) {
multiplier = info["preferred weight"];
}
let prefix = TAC.Globals.CFG.useLoraPrefixForLycos ? "lora" : "lyco";
let prefix = TAC.CFG.useLoraPrefixForLycos ? "lora" : "lyco";
return `<${prefix}:${text}:${multiplier}>`;
}
return null;