2020-10-03 19:10:13 -04:00
|
|
|
const express = require("express");
|
2020-08-16 16:26:04 -04:00
|
|
|
const { CommandManager } = require("knub-command-manager");
|
|
|
|
const { Client } = require("eris");
|
|
|
|
const Knex = require("knex");
|
2020-10-12 13:00:25 -04:00
|
|
|
const threads = require("./data/threads");
|
2020-10-21 17:53:13 -04:00
|
|
|
const displayRoles = require("./data/displayRoles");
|
2020-08-16 16:26:04 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {object} PluginAPI
|
|
|
|
* @property {Client} bot
|
|
|
|
* @property {Knex} knex
|
|
|
|
* @property {ModmailConfig} config
|
|
|
|
* @property {PluginCommandsAPI} commands
|
|
|
|
* @property {PluginAttachmentsAPI} attachments
|
2020-09-22 20:16:26 -04:00
|
|
|
* @property {PluginLogsAPI} logs
|
2020-08-16 16:26:04 -04:00
|
|
|
* @property {PluginHooksAPI} hooks
|
2020-11-01 15:16:15 -05:00
|
|
|
* @property {PluginFormattersAPI} formats
|
|
|
|
* @property {PluginWebServerAPI} webserver
|
|
|
|
* @property {PluginThreadsAPI} threads
|
|
|
|
* @property {PluginDisplayRolesAPI} displayRoles
|
2020-08-16 16:26:04 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {object} PluginCommandsAPI
|
|
|
|
* @property {CommandManager} manager
|
|
|
|
* @property {AddGlobalCommandFn} addGlobalCommand
|
|
|
|
* @property {AddInboxServerCommandFn} addInboxServerCommand
|
|
|
|
* @property {AddInboxThreadCommandFn} addInboxThreadCommand
|
|
|
|
* @property {AddAliasFn} addAlias
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {object} PluginAttachmentsAPI
|
|
|
|
* @property {AddAttachmentStorageTypeFn} addStorageType
|
|
|
|
* @property {DownloadAttachmentFn} downloadAttachment
|
2020-11-02 10:37:07 -05:00
|
|
|
* @property {SaveAttachmentFn} saveAttachment
|
2020-08-16 16:26:04 -04:00
|
|
|
*/
|
|
|
|
|
2020-09-22 20:16:26 -04:00
|
|
|
/**
|
|
|
|
* @typedef {object} PluginLogsAPI
|
|
|
|
* @property {AddLogStorageTypeFn} addStorageType
|
|
|
|
* @property {SaveLogToStorageFn} saveLogToStorage
|
|
|
|
* @property {GetLogUrlFn} getLogUrl
|
|
|
|
* @property {GetLogFileFn} getLogFile
|
|
|
|
* @property {GetLogCustomResponseFn} getLogCustomResponse
|
|
|
|
*/
|
|
|
|
|
2020-08-16 16:26:04 -04:00
|
|
|
/**
|
|
|
|
* @typedef {object} PluginHooksAPI
|
|
|
|
* @property {AddBeforeNewThreadHookFn} beforeNewThread
|
2020-09-22 19:28:41 -04:00
|
|
|
* @property {AddAfterThreadCloseHookFn} afterThreadClose
|
2020-08-16 16:26:04 -04:00
|
|
|
*/
|
2020-11-01 15:16:15 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {displayRoles} PluginDisplayRolesAPI
|
|
|
|
* @see https://github.com/Dragory/modmailbot/blob/master/src/data/displayRoles.js
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {threads} PluginThreadsAPI
|
|
|
|
* @see https://github.com/Dragory/modmailbot/blob/master/src/data/threads.js
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {express.Application} PluginWebServerAPI
|
|
|
|
* @see https://expressjs.com/en/api.html#app
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {FormattersExport} PluginFormattersAPI
|
|
|
|
* @see https://github.com/Dragory/modmailbot/blob/master/src/formatters.js
|
|
|
|
*/
|