3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Fix merge conflict

This commit is contained in:
Dragory 2020-08-05 02:39:03 +03:00
commit f27050a44c
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
12 changed files with 51 additions and 10 deletions

View file

@ -6,6 +6,8 @@ import { Constants as ErisConstants } from "eris";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { CaseTypes } from "../../../data/CaseTypes";
import { safeFindRelevantAuditLogEntry } from "../../../utils/safeFindRelevantAuditLogEntry";
import { LogType } from "src/data/LogType";
import { stripObjectToScalars, resolveUser } from "src/utils";
/**
* Create a BAN case automatically when a user is banned manually.
@ -26,24 +28,39 @@ export const CreateBanCaseOnManualBanEvt = eventListener<ModActionsPluginType>()
);
const casesPlugin = pluginData.getPlugin(CasesPlugin);
let createdCase;
let mod = null;
let reason = "";
if (relevantAuditLogEntry) {
const modId = relevantAuditLogEntry.user.id;
const auditLogId = relevantAuditLogEntry.id;
casesPlugin.createCase({
mod = resolveUser(pluginData.client, modId);
reason = relevantAuditLogEntry.reason;
createdCase = await casesPlugin.createCase({
userId: user.id,
modId,
type: CaseTypes.Ban,
auditLogId,
reason: relevantAuditLogEntry.reason,
reason,
automatic: true,
});
} else {
casesPlugin.createCase({
createdCase = await casesPlugin.createCase({
userId: user.id,
modId: null,
type: CaseTypes.Ban,
});
}
mod = await mod;
pluginData.state.serverLogs.log(LogType.MEMBER_BAN, {
mod: mod ? stripObjectToScalars(mod, ["user"]) : null,
user: stripObjectToScalars(user, ["user"]),
caseNumber: createdCase.case_number,
reason,
});
},
);