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/ public/
html/ html/
plugins plugins/

View File

@ -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'

View File

@ -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
/** /**

View File

@ -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 }

View File

@ -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
*/ */