diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-19 17:42:29 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-19 17:42:29 -0400 |
commit | 0fc87a141609fe7d6a80931b73f59c872b0bd44f (patch) | |
tree | 715d65c8801de4376845c01edfe01abedaabbc91 /src/lib/extensions/discord.js/BushGuild.ts | |
parent | b023e057083f002418d2a685dbfb17faa624b6b1 (diff) | |
download | tanzanite-0fc87a141609fe7d6a80931b73f59c872b0bd44f.tar.gz tanzanite-0fc87a141609fe7d6a80931b73f59c872b0bd44f.tar.bz2 tanzanite-0fc87a141609fe7d6a80931b73f59c872b0bd44f.zip |
change some stuff
Diffstat (limited to 'src/lib/extensions/discord.js/BushGuild.ts')
-rw-r--r-- | src/lib/extensions/discord.js/BushGuild.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/extensions/discord.js/BushGuild.ts b/src/lib/extensions/discord.js/BushGuild.ts index f695f8b..e5eff21 100644 --- a/src/lib/extensions/discord.js/BushGuild.ts +++ b/src/lib/extensions/discord.js/BushGuild.ts @@ -12,12 +12,14 @@ export class BushGuild extends Guild { } public async getSetting<K extends keyof GuildModel>(setting: K): Promise<GuildModel[K]> { - return ((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; + //@ts-ignore: idk why it thinks it doesn't exist + this.client.cache.guilds.set(this.id, row.dataValues) return await row.save(); } |