diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-20 16:36:23 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-20 16:36:23 -0400 |
commit | 5c242f597595b8db71875d92c0afe0a5947442a6 (patch) | |
tree | 13c2878b1e6368f17dd349194c320d2518fe2a9d /src/lib | |
parent | b795a6e51b9ff69ed958f985908f81aff73022dc (diff) | |
parent | e2787c5a15e6b9a0c00bc7ed31fe3d1774fb8ff1 (diff) | |
download | tanzanite-5c242f597595b8db71875d92c0afe0a5947442a6.tar.gz tanzanite-5c242f597595b8db71875d92c0afe0a5947442a6.tar.bz2 tanzanite-5c242f597595b8db71875d92c0afe0a5947442a6.zip |
Merge branch 'rewrite' of https://github.com/NotEnoughUpdates/bush-bot into rewrite
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/extensions/discord.js/BushGuild.ts | 7 | ||||
-rw-r--r-- | src/lib/utils/BushCache.ts | 4 | ||||
-rw-r--r-- | src/lib/utils/BushConstants.ts | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/extensions/discord.js/BushGuild.ts b/src/lib/extensions/discord.js/BushGuild.ts index 9b528c6..79f7c98 100644 --- a/src/lib/extensions/discord.js/BushGuild.ts +++ b/src/lib/extensions/discord.js/BushGuild.ts @@ -12,13 +12,16 @@ export class BushGuild extends Guild { } public async getSetting<K extends keyof GuildModel>(setting: K): Promise<GuildModel[K]> { - return this.client.cache.guilds.get(this.id)?.[setting] ?? ((await GuildDB.findByPk(this.id)) ?? GuildDB.build({ id: this.id }))[setting]; + return ( + this.client.cache.guilds.get(this.id)?.[setting] ?? + ((await GuildDB.findByPk(this.id)) ?? GuildDB.build({ id: this.id }))[setting] + ); } public async setSetting<K extends keyof GuildModel>(setting: K, value: GuildDB[K]): Promise<GuildDB> { const row = (await GuildDB.findByPk(this.id)) ?? GuildDB.build({ id: this.id }); row[setting] = value; - this.client.cache.guilds.set(this.id, row.toJSON() as GuildDB) + this.client.cache.guilds.set(this.id, row.toJSON() as GuildDB); return await row.save(); } diff --git a/src/lib/utils/BushCache.ts b/src/lib/utils/BushCache.ts index 95c2346..f9def5e 100644 --- a/src/lib/utils/BushCache.ts +++ b/src/lib/utils/BushCache.ts @@ -9,9 +9,7 @@ class GlobalCache { public static blacklistedUsers = new Array<Snowflake>(); } - export class BushCache { public static global = GlobalCache; - // eslint-disable-next-line @typescript-eslint/ban-types - public static guilds = new Collection<Snowflake, Guild>() + public static guilds = new Collection<Snowflake, Guild>(); } diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts index 2d05425..5a99798 100644 --- a/src/lib/utils/BushConstants.ts +++ b/src/lib/utils/BushConstants.ts @@ -81,7 +81,7 @@ export class BushConstants { REQUEST_TO_SPEAK: { name: 'Request to Speak', important: false }, USE_PUBLIC_THREADS: { name: 'Use public Threads', important: false }, USE_PRIVATE_THREADS: { name: 'Use Private Threads', important: false }, - MANAGE_THREADS: { name: 'Manage Threads', important: true} + MANAGE_THREADS: { name: 'Manage Threads', important: true } }, features: { |