This commit is contained in:
@ -56,7 +56,7 @@ export default class CreateBot {
|
|||||||
|
|
||||||
mountPlugin(plugins) {
|
mountPlugin(plugins) {
|
||||||
for (let plugin of plugins) {
|
for (let plugin of plugins) {
|
||||||
plugin(this.bot, this.queue);
|
plugin(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import logger from '#root/utils/logger.js'
|
|||||||
const { Middleware } = pkg;
|
const { Middleware } = pkg;
|
||||||
const cookCommand = command.cook;
|
const cookCommand = command.cook;
|
||||||
let Bot;
|
let Bot;
|
||||||
let Queue;
|
|
||||||
|
|
||||||
const commandHandle = {
|
const commandHandle = {
|
||||||
random: randomCook,
|
random: randomCook,
|
||||||
@ -28,12 +27,12 @@ function randomCook(text, data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cookInit() {
|
function cookInit() {
|
||||||
Bot.on(
|
Bot.bot.on(
|
||||||
'GroupMessage',
|
'GroupMessage',
|
||||||
new Middleware().groupFilter(cookSubs.groups).done(dealCommon),
|
new Middleware().groupFilter(cookSubs.groups).done(dealCommon),
|
||||||
);
|
);
|
||||||
|
|
||||||
Bot.on(
|
Bot.bot.on(
|
||||||
'FriendMessage',
|
'FriendMessage',
|
||||||
new Middleware().friendFilter(cookSubs.users).done(dealCommon),
|
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;
|
Bot = bot;
|
||||||
Queue = queue;
|
|
||||||
cookInit();
|
cookInit();
|
||||||
logger('cook 插件加载成功')
|
logger('cook 插件加载成功')
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user