mirai-xiling
基于node-mirai的插件加载框架
使用
const Xiling = require("@xiling-bot/mirai-xiling");
const options = {
host: "localhost:88",
verifyKey: 123456789,
qq: 123456789,
dev: 123456789,
autoLoadPlugin: true,
commandPrefix: "#"
}
const xiling = new Xiling(options);
xiling.use(require("./mirai-xiling-plugins/sleep"));
xiling.listen("all");
插件开发
const plug = {
name: "插件名称",
mounted(xilingOptions) {
console.log(xilingOptions);
},
command: [{
name: "方法1",
exce(msg, parameter) {
msg.reply([{ type: "Plain", text: "我是方法1" }]);
}
}]
priority: [{
name: "最高优先级方法",
exce(msg) {
if (msg.plain.includes("不执行")) {
return true;
}
return false;
}
}]
passive: [{
name: "监听方法",
exce(msg) {
msg.reply(msg.messageChain, msg);
}
}]
}
module.exports = plug;
一些自带的插件:
mirai-xiling-plugins