Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ If enabled, a system message will be posted into any open threads if the user jo
**Default:** `on`
If enabled, a system message will be posted into any open threads if the user leaves a main server

#### overrideRoleNameDisplay
**Default:** `None`
Role name to display in all replies. This completely overrides normal role selection, all replies will contain the string entered. For example; `overrideRoleNameDisplay = Moderator`


#### pingOnBotMention
**Default:** `on`
If enabled, the bot will mention staff (see `mentionRole` option) on the inbox server when the bot is mentioned on the main server.
Expand Down
1 change: 1 addition & 0 deletions src/data/cfg.jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
* @property {boolean} [errorOnUnknownInlineSnippet=true]
* @property {boolean} [allowChangingDisplayRole=true]
* @property {string} [fallbackRoleName=null]
* @property {string} [overrideRoleNameDisplay] Overrides the role displayed on replies
* @property {boolean} [breakFormattingForNames=true]
* @property {boolean} [autoAlert=false]
* @property {string} [autoAlertDelay="2m"] Delay before auto-alert kicks in. Uses the same format as timed close; for example 1m30s for 1 minute and 30 seconds.
Expand Down
6 changes: 6 additions & 0 deletions src/data/cfg.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,12 @@
"default": null
},

"overrideRoleNameDisplay": {
"$comment": "Overrides the role displayed on replies",
"type": "string",
"default": null
},

"breakFormattingForNames": {
"$ref": "#/definitions/customBoolean",
"default": true
Expand Down
4 changes: 2 additions & 2 deletions src/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const bot = require("./bot");
*/
const defaultFormatters = {
formatStaffReplyDM(threadMessage) {
const roleName = threadMessage.role_name || config.fallbackRoleName;
const roleName = config.overrideRoleNameDisplay || threadMessage.role_name || config.fallbackRoleName;
const modInfo = threadMessage.is_anonymous
? roleName
: (roleName ? `(${roleName}) ${threadMessage.user_name}` : threadMessage.user_name);
Expand All @@ -112,7 +112,7 @@ const defaultFormatters = {
},

formatStaffReplyThreadMessage(threadMessage) {
const roleName = threadMessage.role_name || config.fallbackRoleName;
const roleName = config.overrideRoleNameDisplay || threadMessage.role_name || config.fallbackRoleName;
const modInfo = threadMessage.is_anonymous
? (roleName ? `(Anonymous) (${threadMessage.user_name}) ${roleName}` : `(Anonymous) (${threadMessage.user_name})`)
: (roleName ? `(${roleName}) ${threadMessage.user_name}` : threadMessage.user_name);
Expand Down