diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-06-21 16:11:14 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-06-21 16:11:14 -0400 |
commit | 982d71f81f00495b9aed518da1b7bdfb4e50010f (patch) | |
tree | 1bc072483748493b195dd561d7f0d27a10fe4dff /src/tasks/updateCache.ts | |
parent | 4cfd0de634d2883ba84919abc4b9e7ebc025ec27 (diff) | |
download | tanzanite-982d71f81f00495b9aed518da1b7bdfb4e50010f.tar.gz tanzanite-982d71f81f00495b9aed518da1b7bdfb4e50010f.tar.bz2 tanzanite-982d71f81f00495b9aed518da1b7bdfb4e50010f.zip |
fix(*): eslint
Diffstat (limited to 'src/tasks/updateCache.ts')
-rw-r--r-- | src/tasks/updateCache.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/tasks/updateCache.ts b/src/tasks/updateCache.ts index 5994af9..6c1f098 100644 --- a/src/tasks/updateCache.ts +++ b/src/tasks/updateCache.ts @@ -10,19 +10,18 @@ export default class UpdateCacheTask extends BushTask { } async exec(): Promise<void> { const environment = this.client.config.dev ? 'development' : 'production'; - let row = await Global.findByPk(environment); - if (!row) { - row = await Global.create({ + const row = + (await Global.findByPk(environment)) || + (await Global.create({ environment, superUsers: [], blacklistedChannels: [], blacklistedGuilds: [], blacklistedUsers: [], disabledCommands: [] - }); - } + })); - for (let option in row) { + for (const option in row) { if (this.client.cache[option]) this.client.cache[option] = row[option]; } this.client.logger.verbose(`UpdateCache`, `Updated cache.`); |