Add pinThreadHeader option
parent
a5279feb18
commit
7a9bcc5b95
|
@ -278,6 +278,10 @@ If enabled, a system message will be posted into any open threads if the user le
|
|||
**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.
|
||||
|
||||
#### pinThreadHeader
|
||||
**Default:** `off`
|
||||
If enabled, the bot will pin the "thread header" message in each thread that contains the user's details
|
||||
|
||||
#### plugins
|
||||
**Default:** *None*
|
||||
**Accepts multiple values.** External plugins to load on startup. See [Plugins](plugins.md) for more information.
|
||||
|
|
|
@ -464,7 +464,12 @@ class Thread {
|
|||
const msg = await this._postToThreadChannel(finalContent);
|
||||
|
||||
threadMessage.inbox_message_id = msg.id;
|
||||
await this._addThreadMessageToDB(threadMessage.getSQLProps());
|
||||
const finalThreadMessage = await this._addThreadMessageToDB(threadMessage.getSQLProps());
|
||||
|
||||
return {
|
||||
message: msg,
|
||||
threadMessage: finalThreadMessage,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
* @property {string} [fallbackRoleName=null]
|
||||
* @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.
|
||||
* @property {boolean} [pinThreadHeader=false]
|
||||
* @property {string} [logStorage="local"]
|
||||
* @property {object} [logOptions]
|
||||
* @property {string} logOptions.attachmentDirectory
|
||||
|
|
|
@ -357,6 +357,11 @@
|
|||
"description": "Delay before auto-alert kicks in. Uses the same format as timed close; for example 1m30s for 1 minute and 30 seconds."
|
||||
},
|
||||
|
||||
"pinThreadHeader": {
|
||||
"$ref": "#/definitions/customBoolean",
|
||||
"default": false
|
||||
},
|
||||
|
||||
"logStorage": {
|
||||
"type": "string",
|
||||
"default": "local"
|
||||
|
|
|
@ -287,10 +287,14 @@ async function createNewThreadForUser(user, opts = {}) {
|
|||
|
||||
infoHeader += "\n────────────────";
|
||||
|
||||
await newThread.postSystemMessage(infoHeader, {
|
||||
const { message: threadHeaderMessage } = await newThread.postSystemMessage(infoHeader, {
|
||||
allowedMentions: config.mentionUserInThreadHeader ? { users: [user.id] } : undefined,
|
||||
});
|
||||
|
||||
if (config.pinThreadHeader) {
|
||||
await threadHeaderMessage.pin();
|
||||
}
|
||||
|
||||
if (config.updateNotifications) {
|
||||
const availableUpdate = await updates.getAvailableUpdate();
|
||||
if (availableUpdate) {
|
||||
|
|
Loading…
Reference in New Issue