3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

automod: fix mutes not applying

This commit is contained in:
Dragory 2020-01-12 17:17:01 +02:00
parent bec583f96a
commit 73dc0d00fb
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -519,10 +519,6 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema> {
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<TConfigSchema> {
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<TConfigSchema> {
};
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);
}
}