3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-18 07:35:02 +00:00

Add special mention if a mod action was performed on behalf of another mod with the --mmod option

This commit is contained in:
Dragory 2019-02-08 20:25:35 +02:00
parent 359343fb91
commit 0cc131b3ab
4 changed files with 58 additions and 12 deletions

View file

@ -37,7 +37,8 @@ export class CasesPlugin extends ZeppelinPlugin {
args.auditLogId,
args.reason,
args.automatic,
args.postInCaseLog
args.postInCaseLog,
args.ppId
);
});
@ -72,7 +73,8 @@ export class CasesPlugin extends ZeppelinPlugin {
auditLogId: string = null,
reason: string = null,
automatic = false,
postInCaseLogOverride = null
postInCaseLogOverride = null,
ppId = null
): Promise<Case> {
const user = this.bot.users.get(userId);
const userName = user ? `${user.username}#${user.discriminator}` : "Unknown#0000";
@ -80,13 +82,21 @@ export class CasesPlugin extends ZeppelinPlugin {
const mod = this.bot.users.get(modId);
const modName = mod ? `${mod.username}#${mod.discriminator}` : "Unknown#0000";
let ppName = null;
if (ppId) {
const pp = this.bot.users.get(ppId);
ppName = pp ? `${pp.username}#${pp.discriminator}` : "Unknown#0000";
}
const createdCase = await this.cases.create({
type,
user_id: userId,
user_name: userName,
mod_id: modId,
mod_name: modName,
audit_log_id: auditLogId
audit_log_id: auditLogId,
pp_id: ppId,
pp_name: ppName
});
if (reason) {
@ -180,6 +190,10 @@ export class CasesPlugin extends ZeppelinPlugin {
]
};
if (theCase.pp_id) {
embed.fields[1].value += `\np.p. ${theCase.pp_name}\n<@!${theCase.pp_id}>`;
}
if (theCase.is_hidden) {
embed.title += " (hidden)";
}