fixed intents
diff --git a/src/utils/database.ts b/src/utils/database.ts
index b6864b8..8f37466 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -46,6 +46,19 @@
return entry ?? {};
}
+ async updateAllGuilds() {
+ const guilds = await this.guilds.find().toArray();
+ for (const guild of guilds) {
+ let guildObj;
+ try {
+ guildObj = await client.guilds.fetch(guild.id);
+ } catch (e) {
+ guildObj = null;
+ }
+ if(!guildObj) await this.delete(guild.id);
+ }
+ }
+
async read(guild: string): Promise<GuildConfig> {
// console.log("Guild read")
const entry = await this.guilds.findOne({ id: guild });