Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add the custom and competing status types #820

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ The bot's status text. Set to `none` to disable.

#### statusType
**Default:** `playing`
The bot's status type. One of `playing`, `watching`, `listening`, `streaming`.
The bot's status type. One of `playing`, `watching`, `listening`, `streaming`, `custom`, `competing`.

#### statusUrl
**Default:** [nothing]
Expand Down
4 changes: 2 additions & 2 deletions src/data/cfg.jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @property {string} [snippetPrefix="!!"]
* @property {string} [snippetPrefixAnon="!!!"]
* @property {string} [status="Message me for help!"]
* @property {"playing"|"watching"|"listening"|"streaming"} [statusType="playing"]
* @property {"playing"|"watching"|"listening"|"streaming"|"custom"|"competing"} [statusType="playing"]
* @property {string} [statusUrl=""]
* @property {string} [responseMessage="Thank you for your message! Our mod team will reply to you here as soon as possible."]
* @property {string} [closeMessage]
Expand Down Expand Up @@ -78,7 +78,7 @@
* @property {boolean} [errorOnUnknownInlineSnippet=true]
* @property {boolean} [allowChangingDisplayRole=true]
* @property {string} [fallbackRoleName=null]
* @property {string} [overrideRoleNameDisplay] Overrides the role displayed on replies
* @property {string} [overrideRoleNameDisplay=null]
* @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
2 changes: 1 addition & 1 deletion src/data/cfg.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
},
"statusType": {
"type": "string",
"enum": ["playing", "watching", "listening", "streaming"],
"enum": ["playing", "watching", "listening", "streaming", "custom", "competing"],
"default": "playing"
},
"statusUrl": {
Expand Down
4 changes: 4 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,14 @@ function initStatus() {
"watching": Eris.Constants.ActivityTypes.WATCHING,
"listening": Eris.Constants.ActivityTypes.LISTENING,
"streaming": Eris.Constants.ActivityTypes.STREAMING,
"custom": Eris.Constants.ActivityTypes.CUSTOM,
"competing": Eris.Constants.ActivityTypes.COMPETING,
}[config.statusType] || Eris.Constants.ActivityTypes.GAME;

if (type === Eris.Constants.ActivityTypes.STREAMING) {
bot.editStatus(null, { name: config.status, type, url: config.statusUrl });
} else if (type === Eris.Constants.ActivityTypes.CUSTOM) {
bot.editStatus(null, { name: "custom", type, state: config.status });
} else {
bot.editStatus(null, { name: config.status, type });
}
Expand Down