Fixed cache not updating on guild join

This commit is contained in:
2021-09-18 05:35:02 -07:00
parent 0c4b2129cf
commit 50470ca632
2 changed files with 24 additions and 9 deletions
+8
View File
@@ -1,3 +1,4 @@
import { Snowflake } from "discord-api-types";
import Prisma from "./Prisma";
class Cache {
@@ -19,6 +20,13 @@ class Cache {
}
}
public async updateGuildCache(guildID: Snowflake) {
const DBGuild = await Prisma.client.guild.findFirst({ where:{id: guildID} });
if(DBGuild === null) return;
this.setGuildData(guildID, DBGuild);
}
public setGuildData(id: string, data: Object): void {
this.cache.Guilds[id] = data;
}