浏览代码

Report mutes to event logger

ghorsington 4 年之前
父节点
当前提交
98a08526bc
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      bot/src/plugins/violation.ts

+ 4 - 1
bot/src/plugins/violation.ts

@@ -1,7 +1,7 @@
 import { Plugin, ICommandData, Command, Event, BotEventData } from "src/model/plugin";
 import { parseArgs, parseDuration, UNIT_MEASURES, isAuthorisedAsync } from "src/util";
 import { GuildMember, Guild, MessageEmbed, Message, TextChannel, PartialGuildMember, User } from "discord.js";
-import { logger } from "src/logging";
+import { eventLogger, logger } from "src/logging";
 import { client } from "src/client";
 import humanizeDuration from "humanize-duration";
 import { getRepository, ObjectType, FindConditions, DeepPartial } from "typeorm";
@@ -156,6 +156,9 @@ export class ViolationPlugin {
             return;
         }
 
+        if (!info.dryRun) {
+            eventLogger.warn("User %s#%s muted user %s#%s for %s because: %s", message.author.username, message.author.discriminator, info.member.user.username, info.member.user.discriminator, info.duration, info.reason);
+        }
         await this.applyTimedViolation(Mute, info, "mute", handler.start, handler.stop);
         await this.sendViolationMessage(message, info, "User has been muted for server violation");
     }