mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-16 10:19:10 +00:00
styling: standard.js enforcement.
This commit is contained in:
parent
b8da886601
commit
11cf1d4805
9 changed files with 17 additions and 19 deletions
|
@ -13,7 +13,7 @@ class DiscordService extends Service {
|
|||
this.botCallback = `${ctx.config.appUrl}/api/oauth/bot/callback`
|
||||
this.appUrl = process.env.APP_URL
|
||||
this.isBot = process.env.IS_BOT === 'true' || false
|
||||
this.rootUsers = new Set((process.env.ROOT_USERS||'').split(','))
|
||||
this.rootUsers = new Set((process.env.ROOT_USERS || '').split(','))
|
||||
|
||||
this.client = new discord.Client()
|
||||
this.client.options.disableEveryone = true
|
||||
|
@ -27,11 +27,11 @@ class DiscordService extends Service {
|
|||
return this.gm(server, this.client.user.id)
|
||||
}
|
||||
|
||||
fakeGm({id = 0, nickname = '[none]', displayHexColor = '#ffffff'}) {
|
||||
return { id, nickname, displayHexColor, __faked: true, roles: { has() {return false} } }
|
||||
fakeGm ({ id = 0, nickname = '[none]', displayHexColor = '#ffffff' }) {
|
||||
return { id, nickname, displayHexColor, __faked: true, roles: { has () { return false } } }
|
||||
}
|
||||
|
||||
isRoot(id) {
|
||||
isRoot (id) {
|
||||
return this.rootUsers.has(id)
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ class DiscordService extends Service {
|
|||
}
|
||||
]
|
||||
// prefix regex with ^ for ease of code
|
||||
.map(({regex, ...rest}) => ({ regex: new RegExp(`^${regex.source}`, regex.flags), ...rest }))
|
||||
.map(({ regex, ...rest }) => ({ regex: new RegExp(`^${regex.source}`, regex.flags), ...rest }))
|
||||
|
||||
return cmds
|
||||
}
|
||||
|
@ -235,7 +235,6 @@ class DiscordService extends Service {
|
|||
async handleJoin (guild) {
|
||||
await this.ctx.server.ensure(guild)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = DiscordService
|
||||
|
|
|
@ -6,7 +6,7 @@ class SessionsService extends Service {
|
|||
this.Session = ctx.M.Session
|
||||
}
|
||||
|
||||
async get (id, {rolling}) {
|
||||
async get (id, { rolling }) {
|
||||
const user = await this.Session.findOne({ where: { id } })
|
||||
|
||||
if (user === null) {
|
||||
|
@ -16,7 +16,7 @@ class SessionsService extends Service {
|
|||
return user.data
|
||||
}
|
||||
|
||||
async set (id, data, {maxAge, rolling, changed}) {
|
||||
async set (id, data, { maxAge, rolling, changed }) {
|
||||
let session = await this.Session.findOne({ where: { id } })
|
||||
if (session === null) {
|
||||
session = this.Session.build({ id })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue