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) {