Add commands

This commit is contained in:
kwaroran
2024-01-17 07:58:36 +09:00
parent 579d288f6c
commit 4d27bc49c0
2 changed files with 196 additions and 2 deletions

View File

@@ -21,8 +21,9 @@
import { downloadFile } from 'src/ts/storage/globalApi';
import { runTrigger } from 'src/ts/process/triggers';
import { v4 } from 'uuid';
import { postInlayImage } from 'src/ts/image';
import { PreUnreroll, Prereroll } from 'src/ts/process/prereroll';
import { postInlayImage } from 'src/ts/image';
import { PreUnreroll, Prereroll } from 'src/ts/process/prereroll';
import { processMultiCommand } from 'src/ts/process/command';
let messageInput:string = ''
let messageInputTranslate:string = ''
@@ -56,6 +57,15 @@
let cha = $DataBase.characters[selectedChar].chats[$DataBase.characters[selectedChar].chatPage].message
if(messageInput.startsWith('/')){
const commandProcessed = await processMultiCommand(messageInput)
if(commandProcessed !== false){
messageInput = ''
return
}
}
if(messageInput === ''){
if($DataBase.characters[selectedChar].type !== 'group'){
if(cha.length === 0 || cha[cha.length - 1].role !== 'user'){