[fix] optional argument

This commit is contained in:
kwaroran
2023-12-13 05:24:37 +09:00
parent 341ea3c364
commit e681b9ab3f
2 changed files with 44 additions and 27 deletions

View File

@@ -988,4 +988,21 @@ export function getVarChat(targetIndex = -1, chara:character|groupChat = null){
}
}
return vars
}
}
async function editDisplay(text){
let rt = ""
if(!text.includes("<obs>")){
return text
}
for(let i=0;i<text.length;i++){
const obfiEffect = "!@#$%^&*"
if(Math.random() < 0.4){
rt += obfiEffect[Math.floor(Math.random() * obfiEffect.length)]
}
rt += text[i]
}
return rt
}