From 376d3520d2bd9912c0d82323294e12354f5f59c6 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Wed, 31 Aug 2022 23:46:42 +0300 Subject: [PATCH] hnnnng --- src/structure/client/wrappers/GuildWrapper.js | 1 + src/structure/components/observers/Automoderation.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/structure/client/wrappers/GuildWrapper.js b/src/structure/client/wrappers/GuildWrapper.js index 95ad96e..7830a9d 100644 --- a/src/structure/client/wrappers/GuildWrapper.js +++ b/src/structure/client/wrappers/GuildWrapper.js @@ -248,6 +248,7 @@ class GuildWrapper { await settingsMigrator.end(); await modlogsMigrator.end(); + await this.client.mongodb.infractions.deleteMany({ guild: this.id }); await this.client.mongodb.infractions.insertMany(importedModlogs); this._data.caseId = importedModlogs[importedModlogs.length - 1].case; await this.updateData({ diff --git a/src/structure/components/observers/Automoderation.js b/src/structure/components/observers/Automoderation.js index ff4a29f..cb89afe 100644 --- a/src/structure/components/observers/Automoderation.js +++ b/src/structure/components/observers/Automoderation.js @@ -556,7 +556,7 @@ module.exports = class AutoModeration extends Observer { if (!enabled) return; const roles = member?.roles.cache.map((r) => r.id) || []; - if (roles.some((r) => bypass.includes(r)) || ignore.includes(channel.id)) return; + if (roles.some((r) => bypass?.includes(r)) || ignore?.includes(channel.id)) return; const missing = channel.permissionsFor(this.client.user).missing('ManageMessages'); if (missing.length) {