Expose the display roles module to plugins
parent
f4ced372ba
commit
d05672a2dc
|
@ -43,6 +43,8 @@ Please report any bugs you encounter by [creating a GitHub issue](https://github
|
||||||
* System messages now have a formatter
|
* System messages now have a formatter
|
||||||
* The `beforeNewThread` hook's parameters now also include the original DM message object
|
* The `beforeNewThread` hook's parameters now also include the original DM message object
|
||||||
* Plugins can now access the `threads` module (via `pluginApi.threads`) to create and fetch threads
|
* Plugins can now access the `threads` module (via `pluginApi.threads`) to create and fetch threads
|
||||||
|
* Plugins can now access the `displayRoles` module (via `pluginApi.displayRoles`) to get, set, and reset display role overrides for moderators,
|
||||||
|
and to get the final role that will be displayed in moderator replies (by default or per-thread)
|
||||||
|
|
||||||
**Internal/technical updates:**
|
**Internal/technical updates:**
|
||||||
* Modmail now uses [Express](https://expressjs.com/) as its web server for logs/attachments
|
* Modmail now uses [Express](https://expressjs.com/) as its web server for logs/attachments
|
||||||
|
|
|
@ -9,7 +9,7 @@ const attachments = require("./attachments");
|
||||||
const { formatters } = require("../formatters");
|
const { formatters } = require("../formatters");
|
||||||
const { callAfterThreadCloseHooks } = require("../hooks/afterThreadClose");
|
const { callAfterThreadCloseHooks } = require("../hooks/afterThreadClose");
|
||||||
const snippets = require("./snippets");
|
const snippets = require("./snippets");
|
||||||
const { getModeratorThreadDisplayRoleName } = require("./moderatorRoleOverrides");
|
const { getModeratorThreadDisplayRoleName } = require("./displayRoles");
|
||||||
|
|
||||||
const ThreadMessage = require("./ThreadMessage");
|
const ThreadMessage = require("./ThreadMessage");
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ const {
|
||||||
|
|
||||||
getModeratorThreadDisplayRoleName,
|
getModeratorThreadDisplayRoleName,
|
||||||
getModeratorDefaultDisplayRoleName,
|
getModeratorDefaultDisplayRoleName,
|
||||||
} = require("../data/moderatorRoleOverrides");
|
} = require("../data/displayRoles");
|
||||||
|
|
||||||
const ROLE_OVERRIDES_METADATA_KEY = "moderatorRoleOverrides";
|
const ROLE_OVERRIDES_METADATA_KEY = "moderatorRoleOverrides";
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ const { CommandManager } = require("knub-command-manager");
|
||||||
const { Client } = require("eris");
|
const { Client } = require("eris");
|
||||||
const Knex = require("knex");
|
const Knex = require("knex");
|
||||||
const threads = require("./data/threads");
|
const threads = require("./data/threads");
|
||||||
|
const displayRoles = require("./data/displayRoles");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} PluginAPI
|
* @typedef {object} PluginAPI
|
||||||
|
@ -16,6 +17,7 @@ const threads = require("./data/threads");
|
||||||
* @property {FormattersExport} formats
|
* @property {FormattersExport} formats
|
||||||
* @property {express.Application} webserver
|
* @property {express.Application} webserver
|
||||||
* @property {threads} threads
|
* @property {threads} threads
|
||||||
|
* @property {displayRoles} displayRoles
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8,6 +8,7 @@ const childProcess = require("child_process");
|
||||||
const pacote = require("pacote");
|
const pacote = require("pacote");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const threads = require("./data/threads");
|
const threads = require("./data/threads");
|
||||||
|
const displayRoles = require("./data/displayRoles");
|
||||||
|
|
||||||
const pluginSources = {
|
const pluginSources = {
|
||||||
npm: {
|
npm: {
|
||||||
|
@ -130,6 +131,7 @@ module.exports = {
|
||||||
formats,
|
formats,
|
||||||
webserver,
|
webserver,
|
||||||
threads,
|
threads,
|
||||||
|
displayRoles,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue