[fix] triggers

This commit is contained in:
kwaroran
2023-08-03 19:35:30 +09:00
parent 40346e4f24
commit 3af31f8383
2 changed files with 16 additions and 18 deletions

View File

@@ -630,9 +630,11 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
break
}
}
currentChat = db.characters[selectedChar].chats[selectedChat]
const triggerResult = await runTrigger(currentChar, 'output', {chat:currentChat})
if(triggerResult){
console.log(triggerResult)
if(triggerResult && triggerResult.chat){
db.characters[selectedChar].chats[selectedChat] = triggerResult.chat
setDatabase(db)
}
@@ -653,13 +655,17 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
saying: currentChar.chaId
})
db.characters[selectedChar].reloadKeys += 1
const triggerResult = await runTrigger(currentChar, 'output', {chat:currentChat})
if(triggerResult){
db.characters[selectedChar].chats[selectedChat] = triggerResult.chat
}
await sayTTS(currentChar, result)
setDatabase(db)
}
currentChat = db.characters[selectedChar].chats[selectedChat]
const triggerResult = await runTrigger(currentChar, 'output', {chat:currentChat})
if(triggerResult && triggerResult.chat){
db.characters[selectedChar].chats[selectedChat] = triggerResult.chat
setDatabase(db)
}
}
if(req.special){