Improve random selection logic for preset chain names

This commit is contained in:
kwaroran
2024-12-08 22:14:53 +09:00
parent 5178d97a5d
commit 6d64acb9a9

View File

@@ -111,7 +111,8 @@ export async function sendChat(chatProcessIndex = -1,arg:{
if(chatProcessIndex === -1 && DBState.db.presetChain){
const names = DBState.db.presetChain.split(' ')
const ele = names[Math.random() * names.length]
const randomSelect = Math.floor(Math.random() * names.length)
const ele = names[randomSelect]
const findId = DBState.db.botPresets.findIndex((v) => {
return v.name === ele