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); } }