ramirez/src/plugins.js

33 lines
835 B
JavaScript
Raw Normal View History

2020-08-12 17:08:37 -04:00
const attachments = require("./data/attachments");
const { beforeNewThread } = require("./hooks/beforeNewThread");
const formats = require("./formatters");
module.exports = {
getPluginAPI({ bot, knex, config, commands }) {
return {
bot,
knex,
config,
commands: {
manager: commands.manager,
addGlobalCommand: commands.addGlobalCommand,
addInboxServerCommand: commands.addInboxServerCommand,
addInboxThreadCommand: commands.addInboxThreadCommand,
addAlias: commands.addAlias
},
attachments: {
addStorageType: attachments.addStorageType,
downloadAttachment: attachments.downloadAttachment
},
2020-07-13 17:14:31 -04:00
hooks: {
beforeNewThread,
},
formats,
};
},
async loadPlugin(plugin, api) {
await plugin(api);
}
};