Add statusType option
parent
4ea5650289
commit
0c9302b41b
|
@ -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`
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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."
|
||||
|
|
11
src/main.js
11
src/main.js
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue