3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +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

@ -4,12 +4,12 @@ import { CaseTypes } from "../../../data/CaseTypes";
import { Case } from "../../../data/entities/Case";
import { LogType } from "../../../data/LogType";
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 an UNBAN case automatically when a user is unbanned manually.
@ -24,11 +24,7 @@ export const CreateUnbanCaseOnManualUnbanEvt = modActionsEvt({
return;
}
const relevantAuditLogEntry = await safeFindRelevantAuditLogEntry(
pluginData,
GuildAuditLogs.Actions.MEMBER_BAN_REMOVE as number,
user.id,
);
const relevantAuditLogEntry = await findMatchingAuditLogEntry(pluginData.guild, "MEMBER_BAN_REMOVE", user.id);
const casesPlugin = pluginData.getPlugin(CasesPlugin);