refactor: Update lowLevelAccess check in importCharacterCardSpec

This commit is contained in:
kwaroran
2024-05-29 18:37:13 +09:00
parent 2870fb2238
commit 2f5dd4f2f8

View File

@@ -1,11 +1,12 @@
import { get } from "svelte/store"; import { get } from "svelte/store";
import { DataBase, setDatabase } from "../storage/database"; import { DataBase, setDatabase } from "../storage/database";
import { selectedCharID } from "../stores"; import { CurrentCharacter, CurrentChat, selectedCharID } from "../stores";
import { alertInput, alertMd, alertNormal, alertSelect, alertToast } from "../alert"; import { alertInput, alertMd, alertNormal, alertSelect, alertToast } from "../alert";
import { sayTTS } from "./tts"; import { sayTTS } from "./tts";
import { risuChatParser } from "../parser"; import { risuChatParser } from "../parser";
import { sendChat } from "."; import { sendChat } from ".";
import { loadLoreBookV3Prompt } from "./lorebook"; import { loadLoreBookV3Prompt } from "./lorebook";
import { runTrigger } from "./triggers";
export async function processMultiCommand(command:string) { export async function processMultiCommand(command:string) {
let pipe = '' let pipe = ''
@@ -220,6 +221,20 @@ async function processCommand(command:string, pipe:string):Promise<false | strin
alertNormal(p.actives.map((e)=>e.prompt).join('§')) alertNormal(p.actives.map((e)=>e.prompt).join('§'))
return JSON.stringify(p) return JSON.stringify(p)
} }
case 'trigger':{
const currentChar = get(CurrentCharacter)
if(currentChar.type === 'group'){
return;
}
const triggerResult = await runTrigger(currentChar, 'manual', {
chat: get(CurrentChat),
manualName: arg
});
if(triggerResult){
CurrentChat.set(triggerResult.chat);
}
}
case '?':{ case '?':{
alertMd(` alertMd(`
# /input [text] # /input [text]