diff --git a/app.js b/app.js index 425d2b3..17b0022 100644 --- a/app.js +++ b/app.js @@ -2,3 +2,8 @@ import Yunzai from './lib/bot.js' /** 全局变量 bot */ global.Bot = await Yunzai.run() + +if (Bot.uin == "88888") { + /** 跳过登录后加载插件... */ + await ((await import('./lib/plugins/loader.js')).default).load() +} \ No newline at end of file diff --git a/config/default_config/bot.yaml b/config/default_config/bot.yaml index 6348f11..afb9399 100644 --- a/config/default_config/bot.yaml +++ b/config/default_config/bot.yaml @@ -24,6 +24,9 @@ online_msg: true # 上线推送通知的冷却时间 online_msg_exp: 86400 +# 是否跳过登录ICQQ +skip_login: false + # 签名API地址(如:http://127.0.0.1:8080/sign?key=114514) sign_api_addr: # 传入的QQ版本(如:8.9.63、8.9.68) diff --git a/lib/bot.js b/lib/bot.js index 4dbb3f6..2f9063c 100644 --- a/lib/bot.js +++ b/lib/bot.js @@ -14,8 +14,15 @@ export default class Yunzai extends Client { const bot = new Yunzai(cfg.bot) /** 加载icqq事件监听 */ await ListenerLoader.load(bot) - await bot.login(cfg.qq, cfg.pwd) - bot[bot.uin] = bot - return bot + + if (cfg.bot.skip_login) { + /** 造个假~! */ + bot.uin = "88888" + return bot + } else { + await bot.login(cfg.qq, cfg.pwd) + bot[bot.uin] = bot + return bot + } } -} +} \ No newline at end of file diff --git a/lib/config/qq.js b/lib/config/qq.js index 34136f9..2e5621f 100644 --- a/lib/config/qq.js +++ b/lib/config/qq.js @@ -9,6 +9,8 @@ import chalk from 'chalk' * Git Bash 运行npm命令会无法选择列表 */ export default async function createQQ () { + /** 跳过登录ICQQ */ + if(cfg.bot.skip_login) return if (cfg.qq && !process.argv.includes('login')) { return }