2020-08-12 17:08:37 -04:00
|
|
|
const attachments = require("./data/attachments");
|
2020-09-22 20:16:26 -04:00
|
|
|
const logs = require("./data/logs");
|
2020-08-12 17:08:37 -04:00
|
|
|
const { beforeNewThread } = require("./hooks/beforeNewThread");
|
2020-09-22 19:28:41 -04:00
|
|
|
const { afterThreadClose } = require("./hooks/afterThreadClose");
|
2020-08-12 17:08:37 -04:00
|
|
|
const formats = require("./formatters");
|
2020-10-03 19:10:13 -04:00
|
|
|
const { server: webserver } = require("./modules/webserver");
|
2019-09-17 19:15:22 -04:00
|
|
|
|
|
|
|
module.exports = {
|
2020-08-16 16:26:04 -04:00
|
|
|
/**
|
|
|
|
* @param bot
|
|
|
|
* @param knex
|
|
|
|
* @param config
|
|
|
|
* @param commands
|
|
|
|
* @returns {PluginAPI}
|
|
|
|
*/
|
2019-09-17 19:15:22 -04:00
|
|
|
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-09-22 20:16:26 -04:00
|
|
|
logs: {
|
|
|
|
addStorageType: logs.addStorageType,
|
|
|
|
saveLogToStorage: logs.saveLogToStorage,
|
|
|
|
getLogUrl: logs.getLogUrl,
|
|
|
|
getLogFile: logs.getLogFile,
|
|
|
|
getLogCustomResponse: logs.getLogCustomResponse,
|
|
|
|
},
|
2020-07-13 17:14:31 -04:00
|
|
|
hooks: {
|
|
|
|
beforeNewThread,
|
2020-09-22 19:28:41 -04:00
|
|
|
afterThreadClose,
|
2020-07-13 17:14:31 -04:00
|
|
|
},
|
2020-07-13 18:11:48 -04:00
|
|
|
formats,
|
2020-10-03 19:10:13 -04:00
|
|
|
webserver,
|
2019-09-17 19:15:22 -04:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2020-07-13 17:17:31 -04:00
|
|
|
async loadPlugin(plugin, api) {
|
|
|
|
await plugin(api);
|
2019-09-17 19:15:22 -04:00
|
|
|
}
|
|
|
|
};
|