From 9f705a0e5a90177784d45d20200dbaa46a569e78 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 13 Dec 2021 20:22:20 -0500 Subject: fix more bugs --- src/lib/common/AutoMod.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/lib/common/AutoMod.ts') diff --git a/src/lib/common/AutoMod.ts b/src/lib/common/AutoMod.ts index c52754a..932d457 100644 --- a/src/lib/common/AutoMod.ts +++ b/src/lib/common/AutoMod.ts @@ -32,8 +32,7 @@ export class AutoMod { */ private async handle() { if (this.message.channel.type === 'DM' || !this.message.guild) return; - const hasFeature = this.message.guild.hasFeature; - if (!(await hasFeature('automod'))) return; + if (!(await this.message.guild.hasFeature('automod'))) return; const customAutomodPhrases = (await this.message.guild.getSetting('autoModPhases')) ?? {}; const badLinks: BadWords = {}; @@ -52,8 +51,8 @@ export class AutoMod { const result = { ...this.checkWords(customAutomodPhrases), - ...this.checkWords((await hasFeature('excludeDefaultAutomod')) ? {} : badWords), - ...this.checkWords((await hasFeature('excludeAutomodScamLinks')) ? {} : badLinks) + ...this.checkWords((await this.message.guild.hasFeature('excludeDefaultAutomod')) ? {} : badWords), + ...this.checkWords((await this.message.guild.hasFeature('excludeAutomodScamLinks')) ? {} : badLinks) }; if (Object.keys(result).length === 0) return; @@ -77,7 +76,7 @@ export class AutoMod { void this.log(highestOffence, color, result); } - if (!this.punished && (await hasFeature('delScamMentions'))) void this.checkScamMentions(); + if (!this.punished && (await this.message.guild.hasFeature('delScamMentions'))) void this.checkScamMentions(); } /** -- cgit