From baf659f6201f8e619848627a438ce3835db5cebf Mon Sep 17 00:00:00 2001 From: kwaroran Date: Sat, 29 Jun 2024 18:34:38 +0900 Subject: [PATCH] feat: add removeChat function in triggers.ts --- src/ts/process/triggers.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ts/process/triggers.ts b/src/ts/process/triggers.ts index 6e044f4c..1c01f5e8 100644 --- a/src/ts/process/triggers.ts +++ b/src/ts/process/triggers.ts @@ -623,6 +623,13 @@ export async function runTrigger(char:character,mode:triggerMode, arg:{ chat.message = chat.message.slice(start,end) CurrentChat.set(chat) }) + luaEngine.global.set('removeChat', (id:string, index:number) => { + if(!LuaSafeIds.has(id)){ + return + } + chat.message.splice(index, 1) + CurrentChat.set(chat) + }) luaEngine.global.set('addChat', (id:string, role:string, value:string) => { if(!LuaSafeIds.has(id)){ return