Allow for caseNumber in Logs, showing the case number - repalce log evts
This commit is contained in:
parent
6caf7b1304
commit
e131c77e20
13 changed files with 51 additions and 64 deletions
|
@ -30,13 +30,14 @@ export const CreateKickCaseOnManualKickEvt = eventListener<ModActionsPluginType>
|
|||
|
||||
if (kickAuditLogEntry) {
|
||||
const existingCaseForThisEntry = await pluginData.state.cases.findByAuditLogId(kickAuditLogEntry.id);
|
||||
let createdCase;
|
||||
if (existingCaseForThisEntry) {
|
||||
logger.warn(
|
||||
`Tried to create duplicate case for audit log entry ${kickAuditLogEntry.id}, existing case id ${existingCaseForThisEntry.id}`,
|
||||
);
|
||||
} else {
|
||||
const casesPlugin = pluginData.getPlugin(CasesPlugin);
|
||||
casesPlugin.createCase({
|
||||
createdCase = await casesPlugin.createCase({
|
||||
userId: member.id,
|
||||
modId: kickAuditLogEntry.user.id,
|
||||
type: CaseTypes.Kick,
|
||||
|
@ -49,6 +50,7 @@ export const CreateKickCaseOnManualKickEvt = eventListener<ModActionsPluginType>
|
|||
pluginData.state.serverLogs.log(LogType.MEMBER_KICK, {
|
||||
user: stripObjectToScalars(member.user),
|
||||
mod: stripObjectToScalars(kickAuditLogEntry.user),
|
||||
caseNumber: createdCase.case_number,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue