Repository navigation
Expand file tree
/
Copy pathpluginApi.js
More file actions
72 lines (63 loc) · 2.13 KB
/
Copy pathpluginApi.js
File metadata and controls
72 lines (63 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const express = require("express");
const { CommandManager } = require("knub-command-manager");
const { Client } = require("eris");
const Knex = require("knex");
const threads = require("./data/threads");
const displayRoles = require("./data/displayRoles");
/**
* @typedef {object} PluginAPI
* @property {Client} bot
* @property {Knex} knex
* @property {ModmailConfig} config
* @property {PluginCommandsAPI} commands
* @property {PluginAttachmentsAPI} attachments
* @property {PluginLogsAPI} logs
* @property {PluginHooksAPI} hooks
* @property {PluginFormattersAPI} formats
* @property {PluginWebServerAPI} webserver
* @property {PluginThreadsAPI} threads
* @property {PluginDisplayRolesAPI} displayRoles
*/
/**
* @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
* @property {SaveAttachmentFn} saveAttachment
*/
/**
* @typedef {object} PluginLogsAPI
* @property {AddLogStorageTypeFn} addStorageType
* @property {SaveLogToStorageFn} saveLogToStorage
* @property {GetLogUrlFn} getLogUrl
* @property {GetLogFileFn} getLogFile
* @property {GetLogCustomResponseFn} getLogCustomResponse
*/
/**
* @typedef {object} PluginHooksAPI
* @property {AddBeforeNewThreadHookFn} beforeNewThread
* @property {AddAfterThreadCloseHookFn} afterThreadClose
*/
/**
* @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
*/