From 0fc87a141609fe7d6a80931b73f59c872b0bd44f Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 19 Jul 2021 17:42:29 -0400 Subject: change some stuff --- src/lib/extensions/discord.js/BushGuild.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/extensions/discord.js') 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(setting: K): Promise { - 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(setting: K, value: GuildDB[K]): Promise { 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(); } -- cgit