3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-07 11:07:19 +00:00

refactor: debounce and batch simultaneous audit log requests

This commit is contained in:
Dragory 2021-10-27 00:09:29 +03:00
parent d7c6e34695
commit 8f17a835f9
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
8 changed files with 77 additions and 117 deletions

View file

@ -5,12 +5,12 @@ import { Case } from "../../../data/entities/Case";
import { LogType } from "../../../data/LogType";
import { logger } from "../../../logger";
import { resolveUser, UnknownUser } from "../../../utils";
import { safeFindRelevantAuditLogEntry } from "../../../utils/safeFindRelevantAuditLogEntry";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents";
import { isEventIgnored } from "../functions/isEventIgnored";
import { IgnoredEventType, modActionsEvt } from "../types";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry";
/**
* Create a KICK case automatically when a user is kicked manually.
@ -24,11 +24,7 @@ export const CreateKickCaseOnManualKickEvt = modActionsEvt({
return;
}
const kickAuditLogEntry = await safeFindRelevantAuditLogEntry(
pluginData,
GuildAuditLogs.Actions.MEMBER_KICK as number,
member.id,
);
const kickAuditLogEntry = await findMatchingAuditLogEntry(pluginData.guild, "MEMBER_KICK", member.id);
let mod: User | UnknownUser | null = null;
let createdCase: Case | null = null;