update: 兼容就性保留Runtime
This commit is contained in:
parent
8adcf50e7e
commit
c2a7f3cd6b
|
@ -152,4 +152,4 @@ docs/
|
|||
public/
|
||||
html/
|
||||
|
||||
plugins
|
||||
plugins/
|
|
@ -1,3 +1,4 @@
|
|||
export * from './system.js'
|
||||
import ConfigController from './config.js'
|
||||
export { ConfigController }
|
||||
export { ConfigController }
|
||||
export { createLogin } from './login.js'
|
|
@ -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
|
||||
/**
|
|
@ -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 }
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue