update: 兼容就性保留Runtime
This commit is contained in:
parent
8adcf50e7e
commit
c2a7f3cd6b
|
@ -152,4 +152,4 @@ docs/
|
||||||
public/
|
public/
|
||||||
html/
|
html/
|
||||||
|
|
||||||
plugins
|
plugins/
|
|
@ -1,3 +1,4 @@
|
||||||
export * from './system.js'
|
export * from './system.js'
|
||||||
import ConfigController from './config.js'
|
import ConfigController from './config.js'
|
||||||
export { ConfigController }
|
export { ConfigController }
|
||||||
|
export { createLogin } from './login.js'
|
|
@ -5,16 +5,20 @@ import {
|
||||||
BOT_NAME,
|
BOT_NAME,
|
||||||
CONFIG_DEFAULT_PATH,
|
CONFIG_DEFAULT_PATH,
|
||||||
CONFIG_INIT_PATH,
|
CONFIG_INIT_PATH,
|
||||||
ConfigController as cfg
|
} from './system.js'
|
||||||
} from 'yunzai/config'
|
import cfg from './config.js'
|
||||||
import { sleep } from 'yunzai/utils'
|
|
||||||
|
function sleep(ms: number) {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, ms))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建qq配置文件 `config/bot/qq.yaml`
|
* 创建qq配置文件 `config/bot/qq.yaml`
|
||||||
* Git Bash 运行npm命令会无法选择列表
|
* Git Bash 运行npm命令会无法选择列表
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export async function createQQ() {
|
export async function createLogin() {
|
||||||
/** 跳过登录ICQQ */
|
/** 跳过登录ICQQ */
|
||||||
if (cfg.bot.skip_login) return
|
if (cfg.bot.skip_login) return
|
||||||
/**
|
/**
|
|
@ -4,3 +4,5 @@ export * from './plugins/types.js'
|
||||||
export * from './plugins/common.js'
|
export * from './plugins/common.js'
|
||||||
export * from './icqq.js'
|
export * from './icqq.js'
|
||||||
export * from './bot.js'
|
export * from './bot.js'
|
||||||
|
import Runtime from './plugins/runtime.js'
|
||||||
|
export { Runtime }
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
import 'yunzai/init'
|
import 'yunzai/init'
|
||||||
import { Client } from 'yunzai/core'
|
import { Client } from 'yunzai/core'
|
||||||
import { createQQ } from './qq.js'
|
import { createLogin } from 'yunzai/config'
|
||||||
/**
|
/**
|
||||||
|
* *********************
|
||||||
* 确保所有微任务做好准备后
|
* 确保所有微任务做好准备后
|
||||||
* 再进行宏任务
|
* 再进行宏任务
|
||||||
|
* ****************
|
||||||
*/
|
*/
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
await createQQ()
|
/**
|
||||||
|
* login
|
||||||
|
*/
|
||||||
|
await createLogin()
|
||||||
/**
|
/**
|
||||||
* run
|
* run
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue