mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-13 13:25:03 +00:00
Finish preliminary rework, ready to test
This commit is contained in:
parent
57893e7f76
commit
d0a1beb809
177 changed files with 854 additions and 707 deletions
|
@ -9,6 +9,7 @@ import { LogType } from "../../../data/LogType";
|
|||
import { resolveUser, stripObjectToScalars, UnknownUser } from "../../../utils";
|
||||
import { safeFindRelevantAuditLogEntry } from "../../../utils/safeFindRelevantAuditLogEntry";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { GuildAuditLogs, User } from "discord.js";
|
||||
|
||||
/**
|
||||
* Create a KICK case automatically when a user is kicked manually.
|
||||
|
@ -24,7 +25,7 @@ export const CreateKickCaseOnManualKickEvt = modActionsEvt({
|
|||
|
||||
const kickAuditLogEntry = await safeFindRelevantAuditLogEntry(
|
||||
pluginData,
|
||||
ErisConstants.AuditLogActions.MEMBER_KICK,
|
||||
GuildAuditLogs.Actions.MEMBER_KICK as number,
|
||||
member.id,
|
||||
);
|
||||
|
||||
|
@ -40,7 +41,7 @@ export const CreateKickCaseOnManualKickEvt = modActionsEvt({
|
|||
`Tried to create duplicate case for audit log entry ${kickAuditLogEntry.id}, existing case id ${createdCase.id}`,
|
||||
);
|
||||
} else {
|
||||
mod = await resolveUser(pluginData.client, kickAuditLogEntry.user.id);
|
||||
mod = await resolveUser(pluginData.client, kickAuditLogEntry.executor!.id);
|
||||
|
||||
const config = mod instanceof UnknownUser ? pluginData.config.get() : await pluginData.config.getForUser(mod);
|
||||
|
||||
|
@ -48,7 +49,7 @@ export const CreateKickCaseOnManualKickEvt = modActionsEvt({
|
|||
const casesPlugin = pluginData.getPlugin(CasesPlugin);
|
||||
createdCase = await casesPlugin.createCase({
|
||||
userId: member.id,
|
||||
modId: kickAuditLogEntry.user.id,
|
||||
modId: mod.id,
|
||||
type: CaseTypes.Kick,
|
||||
auditLogId: kickAuditLogEntry.id,
|
||||
reason: kickAuditLogEntry.reason || undefined,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue