convert [discord] to use static properties (#6566)

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
chris48s
2021-06-02 17:50:17 +01:00
committed by GitHub
parent 984be9a214
commit 42a1b82d14

View File

@@ -25,43 +25,31 @@ const documentation = `
`
module.exports = class Discord extends BaseJsonService {
static get category() {
return 'chat'
static category = 'chat'
static route = {
base: 'discord',
pattern: ':serverId',
}
static get route() {
return {
base: 'discord',
pattern: ':serverId',
}
static auth = {
passKey: 'discord_bot_token',
authorizedOrigins: ['https://discord.com'],
isRequired: false,
}
static get auth() {
return {
passKey: 'discord_bot_token',
authorizedOrigins: ['https://discord.com'],
isRequired: false,
}
}
static examples = [
{
title: 'Discord',
namedParams: { serverId: '102860784329052160' },
staticPreview: this.render({ members: 23 }),
documentation,
},
]
static get examples() {
return [
{
title: 'Discord',
namedParams: { serverId: '102860784329052160' },
staticPreview: this.render({ members: 23 }),
documentation,
},
]
}
static _cacheLength = 30
static get _cacheLength() {
return 30
}
static get defaultBadgeData() {
return { label: 'chat' }
}
static defaultBadgeData = { label: 'chat' }
static render({ members }) {
return {