update: 兼容就性保留Runtime

This commit is contained in:
ningmengchongshui 2024-06-17 17:00:01 +08:00
parent 8adcf50e7e
commit c2a7f3cd6b
5 changed files with 20 additions and 8 deletions

2
.gitignore vendored
View File

@ -152,4 +152,4 @@ docs/
public/
html/
plugins
plugins/

View File

@ -1,3 +1,4 @@
export * from './system.js'
import ConfigController from './config.js'
export { ConfigController }
export { createLogin } from './login.js'

View File

@ -5,16 +5,20 @@ import {
BOT_NAME,
CONFIG_DEFAULT_PATH,
CONFIG_INIT_PATH,
ConfigController as cfg
} from 'yunzai/config'
import { sleep } from 'yunzai/utils'
} from './system.js'
import cfg from './config.js'
function sleep(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms))
}
/**
* qq配置文件 `config/bot/qq.yaml`
* Git Bash npm命令会无法选择列表
* @returns
*/
export async function createQQ() {
export async function createLogin() {
/** 跳过登录ICQQ */
if (cfg.bot.skip_login) return
/**

View File

@ -4,3 +4,5 @@ export * from './plugins/types.js'
export * from './plugins/common.js'
export * from './icqq.js'
export * from './bot.js'
import Runtime from './plugins/runtime.js'
export { Runtime }

View File

@ -1,12 +1,17 @@
import 'yunzai/init'
import { Client } from 'yunzai/core'
import { createQQ } from './qq.js'
import { createLogin } from 'yunzai/config'
/**
* *********************
*
*
* ****************
*/
setTimeout(async () => {
await createQQ()
/**
* login
*/
await createLogin()
/**
* run
*/