This commit is contained in:
Erik 2022-08-31 23:46:42 +03:00
parent b86417b24f
commit 376d3520d2
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
2 changed files with 2 additions and 1 deletions

View File

@ -248,6 +248,7 @@ class GuildWrapper {
await settingsMigrator.end(); await settingsMigrator.end();
await modlogsMigrator.end(); await modlogsMigrator.end();
await this.client.mongodb.infractions.deleteMany({ guild: this.id });
await this.client.mongodb.infractions.insertMany(importedModlogs); await this.client.mongodb.infractions.insertMany(importedModlogs);
this._data.caseId = importedModlogs[importedModlogs.length - 1].case; this._data.caseId = importedModlogs[importedModlogs.length - 1].case;
await this.updateData({ await this.updateData({

View File

@ -556,7 +556,7 @@ module.exports = class AutoModeration extends Observer {
if (!enabled) return; if (!enabled) return;
const roles = member?.roles.cache.map((r) => r.id) || []; 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'); const missing = channel.permissionsFor(this.client.user).missing('ManageMessages');
if (missing.length) { if (missing.length) {