diff --git a/src/events/messageDelete.ts b/src/events/messageDelete.ts
index 3a72876..f2301e0 100644
--- a/src/events/messageDelete.ts
+++ b/src/events/messageDelete.ts
@@ -1,17 +1,20 @@
+// @ts-expect-error
+import type { HaikuClient } from "jshaiku";
+import type { GuildAuditLogsEntry, Message } from "discord.js";
+
 export const event = "messageDelete";
 
-export async function callback(client, message) {
+export async function callback(client: HaikuClient, message: Message) {
     try {
         if (message.author.id === client.user.id) return;
-        if (client.noLog.includes(`${message.guild.id}/${message.channel.id}/${message.id}`)) return;
-        const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } =
-            message.channel.client.logger;
+        if (client.noLog.includes(`${message.id}/${message.channel.id}/${message.id}`)) return;
+        const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
         const auditLog = await getAuditLog(message.guild, "MEMBER_BAN_ADD");
-        const audit = auditLog.entries.filter((entry) => entry.target.id === message.author.id).first();
+        const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === message.author.id).first();
         if (audit) {
             if (audit.createdAt - 100 < new Date().getTime()) return;
         }
-        message.reference = message.reference || {};
+        const replyTo = message.reference;
         let content = message.cleanContent;
         content.replace("`", "\\`");
         if (content.length > 256) content = content.substring(0, 253) + "...";
@@ -23,7 +26,7 @@
                 ) ?? []
             ).length;
         let attachmentJump = "";
-        const config = (await client.database.guilds.read(message.guild.id)).logging.attachments.saved[
+        const config = (await client.database.guilds.read(message.guild!.id)).logging.attachments.saved[
             message.channel.id + message.id
         ];
         if (config) {
@@ -49,14 +52,14 @@
                 mentions: message.mentions.users.size,
                 attachments: entry(attachments, attachments + attachmentJump),
                 repliedTo: entry(
-                    message.reference.messageId || null,
-                    message.reference.messageId
-                        ? `[[Jump to message]](https://discord.com/channels/${message.guild.id}/${message.channel.id}/${message.reference.messageId})`
+                    replyTo,
+                    replyTo
+                        ? `[[Jump to message]](https://discord.com/channels/${message.guild!.id}/${message.channel.id}/${replyTo.messageId})`
                         : "None"
                 )
             },
             hidden: {
-                guild: message.channel.guild.id
+                guild: message.guild!.id
             }
         };
         log(data);
