From 1b8a0762b1e4c1d3e4f2a5e2ad1b3dd79d9e273e Mon Sep 17 00:00:00 2001 From: enzi221 Date: Tue, 13 May 2025 23:12:57 +0900 Subject: [PATCH] fix: Return stringified false instead of literal false --- src/ts/process/lua.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ts/process/lua.ts b/src/ts/process/lua.ts index 1629f37a..080d1023 100644 --- a/src/ts/process/lua.ts +++ b/src/ts/process/lua.ts @@ -500,7 +500,11 @@ export async function runLua(code:string, arg:{ const loreBooks = [...selectedChar.chats[selectedChar.chatPage]?.localLore ?? [], ...selectedChar.globalLore, ...getModuleLorebooks()] const found = loreBooks.find((b) => b.comment === search) - return found ? JSON.stringify({ ...found, content: risuChatParser(found.content, { chara: selectedChar }) } satisfies loreBook) : false + if (found) { + 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) => {