Chub cope

This commit is contained in:
Cohee
2023-07-06 20:36:02 +03:00
parent 13ba5cec49
commit d6c3c6f26e

View File

@@ -4091,6 +4091,7 @@ async function downloadChubLorebook(id) {
});
if (!result.ok) {
console.log(await result.text());
throw new Error('Failed to download lorebook');
}
@@ -4133,7 +4134,14 @@ function parseChubUrl(str) {
return null;
}
const domainIndex = splitStr.indexOf('chub.ai');
let domainIndex = -1;
splitStr.forEach((part, index) => {
if (part === 'www.chub.ai' || part === 'chub.ai') {
domainIndex = index;
}
})
const lastTwo = domainIndex !== -1 ? splitStr.slice(domainIndex + 1) : splitStr;
const firstPart = lastTwo[0].toLowerCase();