mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-13 21: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:
parent
4ce59fb99b
commit
e841f20ab0
4 changed files with 58 additions and 12 deletions
|
@ -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)";
|
||||
}
|
||||
|
|
|
@ -339,7 +339,8 @@ export class ModActionsPlugin extends ZeppelinPlugin {
|
|||
userId: args.member.id,
|
||||
modId: mod.id,
|
||||
type: CaseTypes.Warn,
|
||||
reason: args.reason
|
||||
reason: args.reason,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null
|
||||
});
|
||||
|
||||
msg.channel.createMessage(
|
||||
|
@ -419,7 +420,8 @@ export class ModActionsPlugin extends ZeppelinPlugin {
|
|||
userId: args.member.id,
|
||||
modId: mod.id,
|
||||
type: CaseTypes.Mute,
|
||||
reason: args.reason
|
||||
reason: args.reason,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null
|
||||
});
|
||||
await this.mutes.setCaseId(args.member.id, theCase.id);
|
||||
}
|
||||
|
@ -515,7 +517,8 @@ export class ModActionsPlugin extends ZeppelinPlugin {
|
|||
userId: args.member.id,
|
||||
modId: mod.id,
|
||||
type: CaseTypes.Unmute,
|
||||
reason: args.reason
|
||||
reason: args.reason,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null
|
||||
});
|
||||
|
||||
if (unmuteTime) {
|
||||
|
@ -615,7 +618,8 @@ export class ModActionsPlugin extends ZeppelinPlugin {
|
|||
userId: args.member.id,
|
||||
modId: mod.id,
|
||||
type: CaseTypes.Kick,
|
||||
reason: args.reason
|
||||
reason: args.reason,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null
|
||||
});
|
||||
|
||||
// Confirm the action to the moderator
|
||||
|
@ -680,7 +684,8 @@ export class ModActionsPlugin extends ZeppelinPlugin {
|
|||
userId: args.member.id,
|
||||
modId: mod.id,
|
||||
type: CaseTypes.Ban,
|
||||
reason: args.reason
|
||||
reason: args.reason,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null
|
||||
});
|
||||
|
||||
// Confirm the action to the moderator
|
||||
|
@ -733,7 +738,8 @@ export class ModActionsPlugin extends ZeppelinPlugin {
|
|||
userId: args.member.id,
|
||||
modId: mod.id,
|
||||
type: CaseTypes.Softban,
|
||||
reason: args.reason
|
||||
reason: args.reason,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null
|
||||
});
|
||||
|
||||
// Confirm the action to the moderator
|
||||
|
@ -783,7 +789,8 @@ export class ModActionsPlugin extends ZeppelinPlugin {
|
|||
userId: args.userId,
|
||||
modId: mod.id,
|
||||
type: CaseTypes.Unban,
|
||||
reason: args.reason
|
||||
reason: args.reason,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null
|
||||
});
|
||||
|
||||
// Confirm the action
|
||||
|
@ -834,7 +841,8 @@ export class ModActionsPlugin extends ZeppelinPlugin {
|
|||
userId: args.userId,
|
||||
modId: mod.id,
|
||||
type: CaseTypes.Ban,
|
||||
reason: args.reason
|
||||
reason: args.reason,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null
|
||||
});
|
||||
|
||||
// Confirm the action
|
||||
|
@ -970,7 +978,8 @@ export class ModActionsPlugin extends ZeppelinPlugin {
|
|||
userId: args.target,
|
||||
modId: mod.id,
|
||||
type: CaseTypes[type],
|
||||
reason: args.reason
|
||||
reason: args.reason,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null
|
||||
});
|
||||
|
||||
msg.channel.createMessage(successMessage(`Case #${theCase.case_number} created`));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue