[fix] not working groupchat regex
This commit is contained in:
@@ -226,7 +226,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
||||
|
||||
const chat:OpenAIChat = {
|
||||
role: 'assistant',
|
||||
content: processScript(currentChar,
|
||||
content: processScript(nowChatroom,
|
||||
replacePlaceholders(firstMsg, currentChar.name),
|
||||
'editprocess')
|
||||
}
|
||||
@@ -236,7 +236,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
||||
|
||||
const ms = currentChat.message
|
||||
for(const msg of ms){
|
||||
let formedChat = processScript(currentChar,replacePlaceholders(msg.data, currentChar.name), 'editprocess')
|
||||
let formedChat = processScript(nowChatroom,replacePlaceholders(msg.data, currentChar.name), 'editprocess')
|
||||
let name = ''
|
||||
if(msg.role === 'char'){
|
||||
if(msg.saying){
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import { CharEmotion, selectedCharID } from "../stores";
|
||||
import { DataBase, setDatabase, type character, type customscript } from "../storage/database";
|
||||
import { DataBase, setDatabase, type character, type customscript, type groupChat } from "../storage/database";
|
||||
import { downloadFile } from "../storage/globalApi";
|
||||
import { alertError, alertNormal } from "../alert";
|
||||
import { language } from "src/lang";
|
||||
@@ -11,7 +11,7 @@ const randomness = /\|\|\|/g
|
||||
|
||||
type ScriptMode = 'editinput'|'editoutput'|'editprocess'|'editdisplay'
|
||||
|
||||
export function processScript(char:character, data:string, mode:ScriptMode){
|
||||
export function processScript(char:character|groupChat, data:string, mode:ScriptMode){
|
||||
return processScriptFull(char, data, mode).data
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export async function importRegex(){
|
||||
}
|
||||
}
|
||||
|
||||
export function processScriptFull(char:character, data:string, mode:ScriptMode){
|
||||
export function processScriptFull(char:character|groupChat, data:string, mode:ScriptMode){
|
||||
let db = get(DataBase)
|
||||
let emoChanged = false
|
||||
const scripts = (db.globalscript ?? []).concat(char.customscript)
|
||||
|
||||
Reference in New Issue
Block a user