From 73dc0d00fbef04c4ee1a984738cd3632a589511c Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 12 Jan 2020 17:17:01 +0200 Subject: [PATCH] automod: fix mutes not applying --- backend/src/plugins/Automod.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/src/plugins/Automod.ts b/backend/src/plugins/Automod.ts index 7fe773e2..ad0e234e 100644 --- a/backend/src/plugins/Automod.ts +++ b/backend/src/plugins/Automod.ts @@ -519,10 +519,6 @@ export class AutomodPlugin extends ZeppelinPlugin { protected onMessageCreateFn; - protected modActions: ModActionsPlugin; - protected mutes: MutesPlugin; - protected logs: LogsPlugin; - protected savedMessages: GuildSavedMessages; protected archives: GuildArchives; protected guildLogs: GuildLogs; @@ -600,6 +596,10 @@ export class AutomodPlugin extends ZeppelinPlugin { return this.getPlugin("logs"); } + protected getMutes(): MutesPlugin { + return this.getPlugin("mutes"); + } + protected onUnload() { this.unloaded = true; this.savedMessages.events.off("create", this.onMessageCreateFn); @@ -1185,10 +1185,10 @@ export class AutomodPlugin extends ZeppelinPlugin { }; if (matchResult.type === "message" || matchResult.type === "embed" || matchResult.type === "textspam") { - await this.mutes.muteUser(matchResult.userId, duration, reason, caseArgs); + await this.getMutes().muteUser(matchResult.userId, duration, reason, caseArgs); } else if (matchResult.type === "raidspam") { for (const userId of matchResult.userIds) { - await this.mutes.muteUser(userId, duration, reason, caseArgs); + await this.getMutes().muteUser(userId, duration, reason, caseArgs); } }