feat: Return all lore books of same name without sort

This commit is contained in:
enzi221
2025-05-16 03:36:50 +09:00
parent 1b8a0762b1
commit 40e91e59a7

View File

@@ -498,13 +498,9 @@ export async function runLua(code:string, arg:{
} }
const loreBooks = [...selectedChar.chats[selectedChar.chatPage]?.localLore ?? [], ...selectedChar.globalLore, ...getModuleLorebooks()] const loreBooks = [...selectedChar.chats[selectedChar.chatPage]?.localLore ?? [], ...selectedChar.globalLore, ...getModuleLorebooks()]
const found = loreBooks.find((b) => b.comment === search) const found = loreBooks.filter((b) => b.comment === search)
if (found) { return JSON.stringify(found.map((b) => ({ ...b, content: risuChatParser(b.content, { chara: selectedChar }) })))
return JSON.stringify({ ...found, content: risuChatParser(found.content, { chara: selectedChar }) } satisfies loreBook)
} else {
return JSON.stringify(false)
}
}) })
luaEngine.global.set('loadLoreBooksMain', async (id:string, usedContext:number) => { luaEngine.global.set('loadLoreBooksMain', async (id:string, usedContext:number) => {