Much more typing
diff --git a/src/events/inviteDelete.ts b/src/events/inviteDelete.ts
index 2cd3bc5..b07893a 100644
--- a/src/events/inviteDelete.ts
+++ b/src/events/inviteDelete.ts
@@ -1,10 +1,15 @@
+import type { GuildAuditLogsEntry, Invite } from "discord.js";
+// @ts-expect-error
import humanizeDuration from "humanize-duration";
+// @ts-expect-error
+import type { HaikuClient } from "jshaiku";
+
export const event = "inviteDelete";
-export async function callback(client, invite) {
- const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = invite.client.logger;
+export async function callback(client: HaikuClient, invite: Invite) {
+ const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
const auditLog = await getAuditLog(invite.guild, "INVITE_DELETE");
- const audit = auditLog.entries.filter((entry) => entry.target.id === invite.id).first();
+ const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === invite.inviterId).first();
if (audit.executor.id === client.user.id) return;
const data = {
meta: {
@@ -23,7 +28,7 @@
deleted: entry(new Date().getTime(), renderDelta(new Date().getTime()))
},
hidden: {
- guild: invite.guild.id
+ guild: invite.guild!.id
}
};
log(data);