diff --git a/src/events/guildBanAdd.ts b/src/events/guildBanAdd.ts
index 5fd0b49..3d96245 100644
--- a/src/events/guildBanAdd.ts
+++ b/src/events/guildBanAdd.ts
@@ -1,4 +1,5 @@
-import type { GuildAuditLogsEntry, GuildBan } from "discord.js";
+import type { GuildAuditLogsEntry, GuildBan, User } from "discord.js";
+import { AuditLogEvent } from 'discord.js';
 import { purgeByUser } from "../actions/tickets/delete.js";
 import { callback as statsChannelRemove } from "../reflex/statsChannelUpdate.js";
 import type { NucleusClient } from "../utils/client.js";
@@ -7,12 +8,13 @@
 
 export async function callback(client: NucleusClient, ban: GuildBan) {
     await statsChannelRemove(client, undefined, ban.guild, ban.user);
-    purgeByUser(ban.user.id, ban.guild);
+    purgeByUser(ban.user.id, ban.guild.id);
     const { log, NucleusColors, entry, renderUser, renderDelta, getAuditLog } = client.logger;
-    const auditLog = await getAuditLog(ban.guild, "MEMBER_BAN_ADD");
-    const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === ban.user.id).first();
-    if (audit.executor.id === client.user.id) return;
-    await client.database.history.create("ban", ban.guild.id, ban.user, audit.executor, audit.reason);
+    const auditLog: GuildAuditLogsEntry | undefined = (await getAuditLog(ban.guild, AuditLogEvent.EmojiCreate))
+        .filter((entry: GuildAuditLogsEntry) => ((entry.target! as User).id === ban.user.id))[0];
+    if (!auditLog) return;
+    if (auditLog.executor!.id === client.user!.id) return;
+    await client.database.history.create("ban", ban.guild.id, ban.user, auditLog.executor, auditLog.reason);
     const data = {
         meta: {
             type: "memberBan",
@@ -26,9 +28,9 @@
             memberId: entry(ban.user.id, `\`${ban.user.id}\``),
             name: entry(ban.user.id, renderUser(ban.user)),
             banned: entry(new Date().getTime(), renderDelta(new Date().getTime())),
-            bannedBy: entry(audit.executor.id, renderUser(audit.executor)),
-            reason: entry(audit.reason, audit.reason ? `\n> ${audit.reason}` : "*No reason provided.*"),
-            accountCreated: entry(ban.user.createdAt, renderDelta(ban.user.createdAt)),
+            bannedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+            reason: entry(auditLog.reason, auditLog.reason ? `\n> ${auditLog.reason}` : "*No reason provided.*"),
+            accountCreated: entry(ban.user.createdTimestamp, renderDelta(ban.user.createdTimestamp)),
             serverMemberCount: ban.guild.memberCount
         },
         hidden: {
