feat: v1.2.0
Some checks failed
continuous-integration/drone Build is failing

This commit is contained in:
mol
2023-12-13 18:54:37 +08:00
parent d03ffb0cfc
commit 901f127b8a
20 changed files with 824 additions and 63 deletions

View File

@ -1,8 +1,11 @@
const { Bot } = require('mirai-js');
const Queue = require('../utils/queue');
const logger = require('../utils/logger');
import pkg from 'mirai-js';
import Queue from '#root/utils/queue.js';
import logger from '#root/utils/logger.js';
import plugins from '#root/plugins/index.js';
class CreateBot {
const { Bot } = pkg;
export default class CreateBot {
constructor() {
this.bot = new Bot();
this.queue = new Queue();
@ -16,6 +19,8 @@ class CreateBot {
verifyKey: config.verifyKey,
qq: config.qq,
});
this.mountPlugin(plugins);
}
async sendMessageToFriend(qq, message) {
@ -51,6 +56,10 @@ class CreateBot {
},
);
}
}
module.exports = CreateBot;
mountPlugin(plugins) {
for (let plugin of plugins) {
plugin.install(this.bot, this.queue);
}
}
}