[fix] fix triggers
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user