diff --git a/src/ts/process/index.ts b/src/ts/process/index.ts index 9867ebdb..4d092a97 100644 --- a/src/ts/process/index.ts +++ b/src/ts/process/index.ts @@ -503,7 +503,9 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n await sayTTS(currentChar, result) } else{ - const msgs = req.type === 'success' ? [['char',req.result]] as const : req.type === 'multiline' ? req.result : [] + const msgs = (req.type === 'success') ? [['char',req.result]] as const + : (req.type === 'multiline') ? req.result + : [] for(const msg of msgs){ const msgIndex = db.characters[selectedChar].chats[selectedChat].message.length const result2 = processScriptFull(nowChatroom, reformatContent(msg[1]), 'editoutput', msgIndex) diff --git a/src/ts/process/triggers.ts b/src/ts/process/triggers.ts index 53b4a6e2..2dfc97db 100644 --- a/src/ts/process/triggers.ts +++ b/src/ts/process/triggers.ts @@ -67,14 +67,13 @@ export function runTrigger(char:character,mode:triggerMode, arg:{ historyend: '', promptend: '' } - let varValues = getVarChat(-1, char) - let varValuesChanged = false const triggers = char.triggerscript const chat = arg.chat ?? char.chats[char.chatPage] if(!triggers){ return null } - + let varValues = getVarChat(-1, char) + let varValuesChanged = false for(const trigger of triggers){ if(mode !== trigger.type){ continue