Miao-Yunzai/lib/bot.js

21 lines
498 B
JavaScript
Raw Normal View History

2023-03-04 14:30:13 +08:00
import './config/init.js'
import ListenerLoader from './listener/loader.js'
import { Client } from 'icqq'
import cfg from './config/config.js'
export default class Yunzai extends Client {
// eslint-disable-next-line no-useless-constructor
2023-03-11 09:35:53 +08:00
constructor (conf) {
super(conf)
2023-03-04 14:30:13 +08:00
}
/** 登录机器人 */
static async run () {
const bot = new Yunzai(cfg.bot)
2023-03-04 14:30:13 +08:00
/** 加载icqq事件监听 */
await ListenerLoader.load(bot)
await bot.login(cfg.qq, cfg.pwd)
2023-03-04 14:30:13 +08:00
return bot
}
}