diff --git a/bot/index.js b/bot/index.js index 4c4aa56..8b96978 100644 --- a/bot/index.js +++ b/bot/index.js @@ -56,7 +56,7 @@ export default class CreateBot { mountPlugin(plugins) { for (let plugin of plugins) { - plugin(this.bot, this.queue); + plugin(this); } } } diff --git a/plugins/cook/index.js b/plugins/cook/index.js index 08600f9..59a5683 100644 --- a/plugins/cook/index.js +++ b/plugins/cook/index.js @@ -7,7 +7,6 @@ import logger from '#root/utils/logger.js' const { Middleware } = pkg; const cookCommand = command.cook; let Bot; -let Queue; const commandHandle = { random: randomCook, @@ -28,12 +27,12 @@ function randomCook(text, data) { } function cookInit() { - Bot.on( + Bot.bot.on( 'GroupMessage', new Middleware().groupFilter(cookSubs.groups).done(dealCommon), ); - Bot.on( + Bot.bot.on( 'FriendMessage', new Middleware().friendFilter(cookSubs.users).done(dealCommon), ); @@ -53,9 +52,8 @@ function dealCommon(data) { } } -export default function install(bot, queue) { +export default function install(bot) { Bot = bot; - Queue = queue; cookInit(); logger('cook 插件加载成功') }