import { Mirai } from "mirai-ts" ; import type { MiraiApiHttpSetting } from "mirai-ts" ; import fs from "fs" ; import path from "path" ; import yaml from "js-yaml" ; const qq = 712727946 ; const setting = yaml . load ( fs . readFileSync ( path . resolve ( __dirname , "../mcl/config/net.mamoe.mirai-api-http/setting.yml" ) , "utf8" ) ) as MiraiApiHttpSetting ; const mirai = new Mirai ( setting ) ; async function app ( ) { await mirai . link ( qq ) ; mirai . on ( "message" , ( msg ) => { console . log ( msg ) ; msg . reply ( msg . messageChain ) ; } ) ; mirai . listen ( ) ; } app ( ) ;