fix nolan's bs

This commit is contained in:
Erik 2021-06-20 19:21:18 +03:00
parent 058e12634f
commit ee6959d814
No known key found for this signature in database
GPG Key ID: 7E862371D3409F16

View File

@ -24,7 +24,7 @@ class AuditLogObserver extends Observer {
} }
async guildBanAdd(guild, user) { async guildBanAdd(guild, user) {
const settings = guild.settings(); const settings = await guild.settings();
if(!settings.moderationLog.channel || !settings.moderationLog.infractions.includes('BAN')) return undefined; //This is checked by the infraction handling, but it may save resources if checked earlier. if(!settings.moderationLog.channel || !settings.moderationLog.infractions.includes('BAN')) return undefined; //This is checked by the infraction handling, but it may save resources if checked earlier.
const audit = await this._fetchFirstEntry(guild, user, 'MEMBER_BAN_ADD'); const audit = await this._fetchFirstEntry(guild, user, 'MEMBER_BAN_ADD');
if(!audit || audit.executor.id === this.client.user.id) return undefined; if(!audit || audit.executor.id === this.client.user.id) return undefined;
@ -39,7 +39,7 @@ class AuditLogObserver extends Observer {
} }
async guildBanRemove(guild, user) { async guildBanRemove(guild, user) {
const settings = guild.settings(); const settings = await guild.settings();
if(!settings.moderationLog.channel || !settings.moderationLog.infractions.includes('UNBAN')) return undefined; //This is checked by the infraction handling, but it may save resources if checked earlier. if(!settings.moderationLog.channel || !settings.moderationLog.infractions.includes('UNBAN')) return undefined; //This is checked by the infraction handling, but it may save resources if checked earlier.
const audit = await this._fetchFirstEntry(guild, user, 'MEMBER_BAN_REMOVE'); const audit = await this._fetchFirstEntry(guild, user, 'MEMBER_BAN_REMOVE');
if(!audit || audit.executor.id === this.client.user.id) return undefined; if(!audit || audit.executor.id === this.client.user.id) return undefined;