Refactor preset chain name parsing to split by commas and trim whitespace

This commit is contained in:
kwaroran
2024-12-08 22:21:59 +09:00
parent 6b9b3db953
commit 71ef6099a8

View File

@@ -110,7 +110,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{
doingChat.set(true) doingChat.set(true)
if(chatProcessIndex === -1 && DBState.db.presetChain){ if(chatProcessIndex === -1 && DBState.db.presetChain){
const names = DBState.db.presetChain.split(' ') const names = DBState.db.presetChain.split(',').map((v) => v.trim())
const randomSelect = Math.floor(Math.random() * names.length) const randomSelect = Math.floor(Math.random() * names.length)
const ele = names[randomSelect] const ele = names[randomSelect]