ramirez/src/pluginApi.js

48 lines
1.4 KiB
JavaScript
Raw Normal View History

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");
/**
* @typedef {object} PluginAPI
* @property {Client} bot
* @property {Knex} knex
* @property {ModmailConfig} config
* @property {PluginCommandsAPI} commands
* @property {PluginAttachmentsAPI} attachments
* @property {PluginLogsAPI} logs
2020-08-16 16:26:04 -04:00
* @property {PluginHooksAPI} hooks
* @property {FormattersExport} formats
* @property {express.Application} webserver
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
*/
/**
* @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
*/