Add statusType option

cshd
Dragory 2020-09-23 00:58:18 +03:00
parent 4ea5650289
commit 0c9302b41b
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
4 changed files with 21 additions and 2 deletions

View File

@ -290,7 +290,11 @@ Prefix to use snippets anonymously
#### status
**Default:** `Message me for help`
The bot's "Playing" text
The bot's status text. Set to an empty value - `status = ""` - to disable.
#### statusType
**Default:** `playing`
The bot's status type. One of `playing`, `watching`, `listening`.
#### syncPermissionsOnMove
**Default:** `on`

View File

@ -10,6 +10,7 @@
* @property {string} [snippetPrefix="!!"]
* @property {string} [snippetPrefixAnon="!!!"]
* @property {string} [status="Message me for help!"]
* @property {"playing"|"watching"|"listening"} [statusType="playing"]
* @property {string} [responseMessage="Thank you for your message! Our mod team will reply to you here as soon as possible."]
* @property {string} [closeMessage]
* @property {boolean} [allowUserClose=false]

View File

@ -81,6 +81,11 @@
"type": "string",
"default": "Message me for help!"
},
"statusType": {
"type": "string",
"enum": ["playing", "watching", "listening"],
"default": "playing"
},
"responseMessage": {
"$ref": "#/definitions/multilineString",
"default": "Thank you for your message! Our mod team will reply to you here as soon as possible."

View File

@ -103,7 +103,16 @@ function waitForGuild(guildId) {
function initStatus() {
function applyStatus() {
bot.editStatus(null, {name: config.status});
const type = {
"playing": 0,
"watching": 3,
"listening": 2,
}[config.statusType] || 0;
bot.editStatus(null, {name: config.status, type});
}
if (config.status == null || config.status === "") {
return;
}
// Set the bot status initially, then reapply it every hour since in some cases it gets unset