diff --git a/src/events/channelDelete.ts b/src/events/channelDelete.ts
index af55205..ee46204 100644
--- a/src/events/channelDelete.ts
+++ b/src/events/channelDelete.ts
@@ -40,7 +40,17 @@
             displayName = "Channel";
         }
     }
-    const list = {
+    const list: {
+        channelId: string;
+        name: string;
+        topic?: string | null;
+        type: any;
+        category: any;
+        nsfw?: boolean | null;
+        created: any;
+        deleted: any;
+        deletedBy: any;
+    } = {
         channelId: entry(channel.id, `\`${channel.id}\``),
         name: entry(channel.id, `${channel.name}`),
         topic: null,
diff --git a/src/events/guildCreate.ts b/src/events/guildCreate.ts
index 5ae4248..a5ada67 100644
--- a/src/events/guildCreate.ts
+++ b/src/events/guildCreate.ts
@@ -1,5 +1,4 @@
 import type { Guild } from "discord.js";
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-expect-error
 import type { HaikuClient } from "jshaiku";
 import guide from "../reflex/guide.js";
diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts
index 53de4df..7e4a52f 100644
--- a/src/events/messageCreate.ts
+++ b/src/events/messageCreate.ts
@@ -1,4 +1,3 @@
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-expect-error
 import { HaikuClient } from "jshaiku";
 import {
@@ -14,12 +13,11 @@
 import getEmojiByName from "../utils/getEmojiByName.js";
 import client from "../utils/client.js";
 import { callback as a } from "../reflex/statsChannelUpdate.js";
-import type { Message } from "discord.js";
+import { Message, ThreadChannel } from "discord.js";
 
 export const event = "messageCreate";
 
 export async function callback(_client: HaikuClient, message: Message) {
-    if (!message) return;
     if (!message.guild) return;
     if (message.author.bot) return;
     if (message.channel.type === "DM") return;
@@ -112,129 +110,17 @@
 
     if (fileNames.files.length > 0) {
         for (const element of fileNames.files) {
-            if (!message) return;
             const url = element.url ? element.url : element.local;
-            if (url !== undefined) {
+            if (
+                /\.(jpg|jpeg|png|gif|gifv|webm|webp|mp4|wav|mp3|ogg)$/.test(url)
+            ) {
                 if (
-                    /\.(jpg|jpeg|png|gif|gifv|webm|webp|mp4|wav|mp3|ogg)$/.test(
-                        url
-                    )
+                    config.filters.images.NSFW &&
+                    !(message.channel instanceof ThreadChannel
+                        ? message.channel.parent?.nsfw
+                        : message.channel.nsfw)
                 ) {
-                    if (
-                        config.filters.images.NSFW &&
-                        !(message.channel.type === "GUILD_PUBLIC_THREAD"
-                            ? false
-                            : message.channel.nsfw)
-                    ) {
-                        if (await NSFWCheck(url)) {
-                            createLogException(
-                                message.guild.id,
-                                message.channel.id,
-                                message.id
-                            );
-                            await message.delete();
-                            const data = {
-                                meta: {
-                                    type: "messageDelete",
-                                    displayName: "Message Deleted",
-                                    calculateType: "autoModeratorDeleted",
-                                    color: NucleusColors.red,
-                                    emoji: "MESSAGE.DELETE",
-                                    timestamp: new Date().getTime()
-                                },
-                                separate: {
-                                    start:
-                                        filter +
-                                        " Image detected as NSFW\n\n" +
-                                        (content
-                                            ? `**Message:**\n\`\`\`${content}\`\`\``
-                                            : "**Message:** *Message had no content*")
-                                },
-                                list: list,
-                                hidden: {
-                                    guild: message.channel.guild.id
-                                }
-                            };
-                            return log(data);
-                        }
-                    }
-                    if (config.filters.wordFilter.enabled) {
-                        const text = await TestImage(url);
-                        const check = TestString(
-                            text ?? "",
-                            config.filters.wordFilter.words.loose,
-                            config.filters.wordFilter.words.strict
-                        );
-                        if (check !== null) {
-                            createLogException(
-                                message.guild.id,
-                                message.channel.id,
-                                message.id
-                            );
-                            await message.delete();
-                            const data = {
-                                meta: {
-                                    type: "messageDelete",
-                                    displayName: "Message Deleted",
-                                    calculateType: "autoModeratorDeleted",
-                                    color: NucleusColors.red,
-                                    emoji: "MESSAGE.DELETE",
-                                    timestamp: new Date().getTime()
-                                },
-                                separate: {
-                                    start:
-                                        filter +
-                                        " Image contained filtered word\n\n" +
-                                        (content
-                                            ? `**Message:**\n\`\`\`${content}\`\`\``
-                                            : "**Message:** *Message had no content*")
-                                },
-                                list: list,
-                                hidden: {
-                                    guild: message.channel.guild.id
-                                }
-                            };
-                            return log(data);
-                        }
-                    }
-                    if (config.filters.images.size) {
-                        if (url.match(/\.+(webp|png|jpg)$/gi)) {
-                            if (!(await SizeCheck(element))) {
-                                createLogException(
-                                    message.guild.id,
-                                    message.channel.id,
-                                    message.id
-                                );
-                                await message.delete();
-                                const data = {
-                                    meta: {
-                                        type: "messageDelete",
-                                        displayName: "Message Deleted",
-                                        calculateType: "autoModeratorDeleted",
-                                        color: NucleusColors.red,
-                                        emoji: "MESSAGE.DELETE",
-                                        timestamp: new Date().getTime()
-                                    },
-                                    separate: {
-                                        start:
-                                            filter +
-                                            " Image was too small\n\n" +
-                                            (content
-                                                ? `**Message:**\n\`\`\`${content}\`\`\``
-                                                : "**Message:** *Message had no content*")
-                                    },
-                                    list: list,
-                                    hidden: {
-                                        guild: message.channel.guild.id
-                                    }
-                                };
-                                return log(data);
-                            }
-                        }
-                    }
-                }
-                if (config.filters.malware) {
-                    if (!MalwareCheck(url)) {
+                    if (await NSFWCheck(url)) {
                         createLogException(
                             message.guild.id,
                             message.channel.id,
@@ -253,7 +139,7 @@
                             separate: {
                                 start:
                                     filter +
-                                    " File detected as malware\n\n" +
+                                    " Image detected as NSFW\n\n" +
                                     (content
                                         ? `**Message:**\n\`\`\`${content}\`\`\``
                                         : "**Message:** *Message had no content*")
@@ -266,10 +152,116 @@
                         return log(data);
                     }
                 }
+                if (config.filters.wordFilter.enabled) {
+                    const text = await TestImage(url);
+                    const check = TestString(
+                        text ?? "",
+                        config.filters.wordFilter.words.loose,
+                        config.filters.wordFilter.words.strict
+                    );
+                    if (check !== null) {
+                        createLogException(
+                            message.guild.id,
+                            message.channel.id,
+                            message.id
+                        );
+                        await message.delete();
+                        const data = {
+                            meta: {
+                                type: "messageDelete",
+                                displayName: "Message Deleted",
+                                calculateType: "autoModeratorDeleted",
+                                color: NucleusColors.red,
+                                emoji: "MESSAGE.DELETE",
+                                timestamp: new Date().getTime()
+                            },
+                            separate: {
+                                start:
+                                    filter +
+                                    " Image contained filtered word\n\n" +
+                                    (content
+                                        ? `**Message:**\n\`\`\`${content}\`\`\``
+                                        : "**Message:** *Message had no content*")
+                            },
+                            list: list,
+                            hidden: {
+                                guild: message.channel.guild.id
+                            }
+                        };
+                        return log(data);
+                    }
+                }
+                if (config.filters.images.size) {
+                    if (url.match(/\.+(webp|png|jpg)$/gi)) {
+                        if (!(await SizeCheck(element))) {
+                            createLogException(
+                                message.guild.id,
+                                message.channel.id,
+                                message.id
+                            );
+                            await message.delete();
+                            const data = {
+                                meta: {
+                                    type: "messageDelete",
+                                    displayName: "Message Deleted",
+                                    calculateType: "autoModeratorDeleted",
+                                    color: NucleusColors.red,
+                                    emoji: "MESSAGE.DELETE",
+                                    timestamp: new Date().getTime()
+                                },
+                                separate: {
+                                    start:
+                                        filter +
+                                        " Image was too small\n\n" +
+                                        (content
+                                            ? `**Message:**\n\`\`\`${content}\`\`\``
+                                            : "**Message:** *Message had no content*")
+                                },
+                                list: list,
+                                hidden: {
+                                    guild: message.channel.guild.id
+                                }
+                            };
+                            return log(data);
+                        }
+                    }
+                }
+            }
+            if (config.filters.malware) {
+                if (!(await MalwareCheck(url))) {
+                    createLogException(
+                        message.guild.id,
+                        message.channel.id,
+                        message.id
+                    );
+                    await message.delete();
+                    const data = {
+                        meta: {
+                            type: "messageDelete",
+                            displayName: "Message Deleted",
+                            calculateType: "autoModeratorDeleted",
+                            color: NucleusColors.red,
+                            emoji: "MESSAGE.DELETE",
+                            timestamp: new Date().getTime()
+                        },
+                        separate: {
+                            start:
+                                filter +
+                                " File detected as malware\n\n" +
+                                (content
+                                    ? `**Message:**\n\`\`\`${content}\`\`\``
+                                    : "**Message:** *Message had no content*")
+                        },
+                        list: list,
+                        hidden: {
+                            guild: message.channel.guild.id
+                        }
+                    };
+                    return log(data);
+                }
             }
         }
     }
-    if (!message) return;
 
     const linkDetectionTypes = await LinkCheck(message);
     if (linkDetectionTypes.length > 0) {
@@ -363,7 +355,6 @@
     }
     if (config.filters.pings.roles) {
         for (const roleId in message.mentions.roles) {
-            if (!message) return;
             if (!config.filters.pings.allowed.roles.includes(roleId)) {
                 createLogException(
                     message.guild.id,
diff --git a/src/events/webhookUpdate.ts b/src/events/webhookUpdate.ts
index f600247..ae88cac 100644
--- a/src/events/webhookUpdate.ts
+++ b/src/events/webhookUpdate.ts
@@ -1,5 +1,4 @@
 import type Discord from "discord.js";
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-expect-error
 import type { HaikuClient } from "jshaiku";
 export const event = "webhookUpdate";
