diff --git a/src/Unfinished/categorisationTest.ts b/src/Unfinished/categorisationTest.ts
index e4346d6..8c25eb2 100644
--- a/src/Unfinished/categorisationTest.ts
+++ b/src/Unfinished/categorisationTest.ts
@@ -7,7 +7,8 @@
     MessageSelectMenu
 } from "discord.js";
 import { SlashCommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
+// @ts-expect-error
+import type { WrappedCheck } from "jshaiku";
 import EmojiEmbed from "../utils/generateEmojiEmbed.js";
 import client from "../utils/client.js";
 import addPlural from "../utils/plurals.js";
@@ -17,9 +18,7 @@
     .setName("categorise")
     .setDescription("Categorises your servers channels");
 
-const callback = async (
-    interaction: CommandInteraction
-): Promise<void | unknown> => {
+const callback = async (interaction: CommandInteraction): Promise<unknown> => {
     const channels = interaction.guild.channels.cache.filter(
         (c) => c.type !== "GUILD_CATEGORY"
     );
diff --git a/src/commands/mod/info.ts b/src/commands/mod/info.ts
index 86a4c4a..9837273 100644
--- a/src/commands/mod/info.ts
+++ b/src/commands/mod/info.ts
@@ -1,4 +1,4 @@
-import { HistorySchema } from "../../utils/database";
+import { HistorySchema } from "../../utils/database.js";
 import Discord, {
     CommandInteraction,
     GuildMember,
diff --git a/src/commands/mod/mute.ts b/src/commands/mod/mute.ts
index 5be6f43..b430191 100644
--- a/src/commands/mod/mute.ts
+++ b/src/commands/mod/mute.ts
@@ -71,17 +71,15 @@
                 .setRequired(false)
         );
 
-const callback = async (
-    interaction: CommandInteraction
-): Promise<void | unknown> => {
+const callback = async (interaction: CommandInteraction): Promise<unknown> => {
     const { log, NucleusColors, renderUser, entry, renderDelta } =
         client.logger;
     const user = interaction.options.getMember("user") as GuildMember;
     const time = {
-        days: interaction.options.getInteger("days") || 0,
-        hours: interaction.options.getInteger("hours") || 0,
-        minutes: interaction.options.getInteger("minutes") || 0,
-        seconds: interaction.options.getInteger("seconds") || 0
+        days: interaction.options.getInteger("days") ?? 0,
+        hours: interaction.options.getInteger("hours") ?? 0,
+        minutes: interaction.options.getInteger("minutes") ?? 0,
+        seconds: interaction.options.getInteger("seconds") ?? 0
     };
     const config = await client.database.guilds.read(interaction.guild.id);
     let serverSettingsDescription = config.moderation.mute.timeout
diff --git a/src/commands/settings/logs/attachment.ts b/src/commands/settings/logs/attachment.ts
index f37bd1a..ea8aa51 100644
--- a/src/commands/settings/logs/attachment.ts
+++ b/src/commands/settings/logs/attachment.ts
@@ -1,5 +1,5 @@
 import { LoadingEmbed } from "./../../../utils/defaultEmbeds.js";
-import { ChannelType } from "discord-api-types";
+import { ChannelType } from "discord-api-types/v9";
 import Discord, {
     CommandInteraction,
     MessageActionRow,
diff --git a/src/commands/settings/logs/channel.ts b/src/commands/settings/logs/channel.ts
index 00d2411..fd64424 100644
--- a/src/commands/settings/logs/channel.ts
+++ b/src/commands/settings/logs/channel.ts
@@ -1,5 +1,5 @@
 import { LoadingEmbed } from "./../../../utils/defaultEmbeds.js";
-import { ChannelType } from "discord-api-types";
+import { ChannelType } from "discord-api-types/v9";
 import Discord, {
     CommandInteraction,
     MessageActionRow,
diff --git a/src/commands/settings/logs/staff.ts b/src/commands/settings/logs/staff.ts
index 718d13b..a0df97c 100644
--- a/src/commands/settings/logs/staff.ts
+++ b/src/commands/settings/logs/staff.ts
@@ -1,5 +1,5 @@
 import { LoadingEmbed } from "./../../../utils/defaultEmbeds.js";
-import { ChannelType } from "discord-api-types";
+import { ChannelType } from "discord-api-types/v9";
 import Discord, {
     CommandInteraction,
     MessageActionRow,
@@ -9,7 +9,6 @@
 import confirmationMessage from "../../../utils/confirmationMessage.js";
 import getEmojiByName from "../../../utils/getEmojiByName.js";
 import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-expect-error
 import type { WrappedCheck } from "jshaiku";
 import client from "../../../utils/client.js";
diff --git a/src/commands/settings/tickets.ts b/src/commands/settings/tickets.ts
index 5e5cbe7..206e157 100644
--- a/src/commands/settings/tickets.ts
+++ b/src/commands/settings/tickets.ts
@@ -19,7 +19,7 @@
     SelectMenuOption,
     SlashCommandSubcommandBuilder
 } from "@discordjs/builders";
-import { ChannelType } from "discord-api-types";
+import { ChannelType } from "discord-api-types/v9";
 import client from "../../utils/client.js";
 import {
     toHexInteger,
diff --git a/src/commands/settings/welcome.ts b/src/commands/settings/welcome.ts
index 3eb0ec5..00b1826 100644
--- a/src/commands/settings/welcome.ts
+++ b/src/commands/settings/welcome.ts
@@ -8,12 +8,12 @@
     MessageComponentInteraction,
     Role
 } from "discord.js";
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import client from "../../utils/client.js";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import generateKeyValueList from "../../utils/generateKeyValueList.js";
-import { ChannelType } from "discord-api-types";
+import { ChannelType } from "discord-api-types/v9";
 import getEmojiByName from "../../utils/getEmojiByName.js";
 
 const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -49,9 +49,7 @@
                 .addChannelTypes([ChannelType.GuildText, ChannelType.GuildNews])
         );
 
-const callback = async (
-    interaction: CommandInteraction
-): Promise<void | unknown> => {
+const callback = async (interaction: CommandInteraction): Promise<unknown> => {
     const { renderRole, renderChannel, log, NucleusColors, entry, renderUser } =
         client.logger;
     await interaction.reply({
@@ -340,7 +338,9 @@
 const check = (interaction: CommandInteraction) => {
     const member = interaction.member as Discord.GuildMember;
     if (!member.permissions.has("MANAGE_GUILD"))
-        throw "You must have the *Manage Server* permission to use this command";
+        throw new Error(
+            "You must have the *Manage Server* permission to use this command"
+        );
     return true;
 };
 
diff --git a/src/commands/tags/edit.ts b/src/commands/tags/edit.ts
index 192a2d4..5aaec40 100644
--- a/src/commands/tags/edit.ts
+++ b/src/commands/tags/edit.ts
@@ -1,5 +1,5 @@
-import Discord, { CommandInteraction } from "discord.js";
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import type { CommandInteraction, GuildMember } from "discord.js";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import keyValueList from "../../utils/generateKeyValueList.js";
@@ -28,10 +28,11 @@
                 .setDescription("The new name of the tag / Edit")
         );
 
-const callback = async (interaction: CommandInteraction): Promise<void> => {
+const callback = async (interaction: CommandInteraction): Promise<unknown> => {
+    if (!interaction.guild) return;
     const name = interaction.options.getString("name");
-    const value = interaction.options.getString("value") || "";
-    const newname = interaction.options.getString("newname") || "";
+    const value = interaction.options.getString("value") ?? "";
+    const newname = interaction.options.getString("newname") ?? "";
     if (!newname && !value)
         return await interaction.reply({
             embeds: [
@@ -155,9 +156,11 @@
 };
 
 const check = (interaction: CommandInteraction) => {
-    const member = interaction.member as Discord.GuildMember;
+    const member = interaction.member as GuildMember;
     if (!member.permissions.has("MANAGE_MESSAGES"))
-        throw "You must have the *Manage Messages* permission to use this command";
+        throw new Error(
+            "You must have the *Manage Messages* permission to use this command"
+        );
     return true;
 };
 
diff --git a/src/commands/user/about.ts b/src/commands/user/about.ts
index 5f096ae..129359f 100644
--- a/src/commands/user/about.ts
+++ b/src/commands/user/about.ts
@@ -55,8 +55,9 @@
 }
 
 const callback = async (interaction: CommandInteraction): Promise<void> => {
+    if (!interaction.guild) return;
     const { renderUser, renderDelta } = client.logger;
-    const member = (interaction.options.getMember("user") ||
+    const member = (interaction.options.getMember("user") ??
         interaction.member) as Discord.GuildMember;
     const flags: string[] = [];
     if (
@@ -107,26 +108,29 @@
     };
     const members = await interaction.guild.members.fetch();
     const membersArray = [...members.values()];
-    membersArray.sort((a, b) => a.joinedTimestamp - b.joinedTimestamp);
+    membersArray.sort((a, b) => {
+        if (a.joinedTimestamp === null) return 1;
+        if (b.joinedTimestamp === null) return -1;
+        return a.joinedTimestamp - b.joinedTimestamp;
+    });
     const joinPos = membersArray.findIndex((m) => m.id === member.user.id);
 
     const roles = member.roles.cache
-        .filter((r) => r.id !== interaction.guild.id)
+        .filter((r) => r.id !== interaction.guild!.id)
         .sort();
     let s = "";
     let count = 0;
     let ended = false;
-    roles.map((item) => {
-        if (ended) return;
-        const string = `<@&${item.id}>, `;
+    for (const roleId in roles) {
+        const string = `<@&${roleId}>, `;
         if (s.length + string.length > 1000) {
             ended = true;
             s += `and ${roles.size - count} more`;
-            return;
+            break;
         }
         count++;
         s += string;
-    });
+    }
     if (s.length > 0 && !ended) s = s.slice(0, -2);
 
     let perms = "";
diff --git a/src/commands/user/avatar.ts b/src/commands/user/avatar.ts
index 35c475f..502e9c8 100644
--- a/src/commands/user/avatar.ts
+++ b/src/commands/user/avatar.ts
@@ -19,7 +19,7 @@
 
 const callback = async (interaction: CommandInteraction): Promise<void> => {
     const { renderUser } = client.logger;
-    const member = (interaction.options.getMember("user") ||
+    const member = (interaction.options.getMember("user") ??
         interaction.member) as Discord.GuildMember;
     await interaction.reply({
         embeds: [
@@ -33,7 +33,7 @@
                         url: member.user.displayAvatarURL({ dynamic: true })
                     })
                 )
-                .setImage(await member.user.displayAvatarURL({ dynamic: true }))
+                .setImage(member.user.displayAvatarURL({ dynamic: true }))
         ],
         ephemeral: true,
         fetchReply: true
diff --git a/src/commands/user/track.ts b/src/commands/user/track.ts
index e0e41e0..1a4c308 100644
--- a/src/commands/user/track.ts
+++ b/src/commands/user/track.ts
@@ -10,7 +10,6 @@
     SelectMenuOption,
     SlashCommandSubcommandBuilder
 } from "@discordjs/builders";
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-expect-error
 import { WrappedCheck } from "jshaiku";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
@@ -45,9 +44,7 @@
     return "TRACKS.VERTICAL.MIDDLE." + disabled + active;
 };
 
-const callback = async (
-    interaction: CommandInteraction
-): Promise<void | unknown> => {
+const callback = async (interaction: CommandInteraction): Promise<unknown> => {
     const { renderUser } = client.logger;
     const member = interaction.options.getMember("user") as GuildMember;
     const guild = interaction.guild;
@@ -57,7 +54,7 @@
     let track = 0;
     let generated;
     const roles = await guild.roles.fetch();
-    const memberRoles = await member.roles;
+    const memberRoles = member.roles;
     let managed: boolean;
     while (true) {
         const data = config.tracks[track];
@@ -137,9 +134,8 @@
                 })
                 .join("\n");
         const selected = [];
-        for (let i = 0; i < data.track.length; i++) {
-            if (memberRoles.cache.has(data.track[i]))
-                selected.push(data.track[i]);
+        for (const position of data.track) {
+            if (memberRoles.cache.has(position)) selected.push(position);
         }
         const conflict = data.retainPrevious ? false : selected.length > 1;
         let conflictDropdown;
@@ -278,7 +274,8 @@
 ) => {
     const tracks = (await client.database.guilds.read(interaction.guild.id))
         .tracks;
-    if (tracks.length === 0) throw "This server does not have any tracks";
+    if (tracks.length === 0)
+        throw new Error("This server does not have any tracks");
     const member = interaction.member as GuildMember;
     // Allow the owner to promote anyone
     if (member.id === interaction.guild.ownerId) return true;
@@ -297,7 +294,7 @@
     }
     // Check if the user has manage_roles permission
     if (!managed && !member.permissions.has("MANAGE_ROLES"))
-        throw "You do not have the *Manage Roles* permission";
+        throw new Error("You do not have the *Manage Roles* permission");
     // Allow track
     return true;
 };
diff --git a/src/commands/verify.ts b/src/commands/verify.ts
index d1a0659..2319284 100644
--- a/src/commands/verify.ts
+++ b/src/commands/verify.ts
@@ -1,6 +1,5 @@
 import type { CommandInteraction } from "discord.js";
 import { SlashCommandBuilder } from "@discordjs/builders";
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-expect-error
 import { WrappedCheck } from "jshaiku";
 import verify from "../reflex/verify.js";
diff --git a/src/config/format.ts b/src/config/format.ts
index 3b977fb..7b68ebf 100644
--- a/src/config/format.ts
+++ b/src/config/format.ts
@@ -1,5 +1,4 @@
 import fs from "fs";
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-expect-error
 import * as readLine from "node:readline/promises";
 
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";
diff --git a/src/index.ts b/src/index.ts
index e66dbb3..e40a816 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -5,8 +5,8 @@
 import client from "./utils/client.js";
 import EventScheduler from "./utils/eventScheduler.js";
 
-await client.registerCommandsIn("./commands");
-await client.registerEventsIn("./events");
+await client.registerCommandsIn(`dist/commands`);
+await client.registerEventsIn(`dist/events`);
 client.on("ready", () => {
     runServer(client);
 });
diff --git a/src/premium/attachmentLogs.ts b/src/premium/attachmentLogs.ts
index 679627d..899cd25 100644
--- a/src/premium/attachmentLogs.ts
+++ b/src/premium/attachmentLogs.ts
@@ -22,7 +22,7 @@
             size: attachment.size
         });
     }
-    const links = message.content.match(/https?:\/\/\S+/gi) || [];
+    const links = message.content.match(/https?:\/\/\S+/gi) ?? [];
     for (const link of links) {
         if (
             link
diff --git a/src/reflex/scanners.ts b/src/reflex/scanners.ts
index 162b85a..2f6f526 100644
--- a/src/reflex/scanners.ts
+++ b/src/reflex/scanners.ts
@@ -1,4 +1,3 @@
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-expect-error
 import * as us from "unscan";
 import fetch from "node-fetch";
@@ -17,13 +16,13 @@
 export async function testNSFW(link: string): Promise<NSFWSchema> {
     const p = await saveAttachment(link);
     const result = await us.nsfw.file(p);
-    return result;
+    return { nsfw: result.nsfw ?? false };
 }
 
 export async function testMalware(link: string): Promise<MalwareSchema> {
     const p = await saveAttachment(link);
     const result = await us.malware.file(p);
-    return result;
+    return { safe: result.safe ?? true };
 }
 
 export async function saveAttachment(link: string): Promise<string> {
diff --git a/src/utils/database.ts b/src/utils/database.ts
index 3592c95..140dbcc 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -1,6 +1,5 @@
 import type Discord from "discord.js";
 import { Collection, MongoClient } from "mongodb";
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-expect-error
 import structuredClone from "@ungap/structured-clone";
 import config from "../config/main.json" assert { type: "json" };
@@ -95,10 +94,10 @@
         }
     }
 
-    // eslint-disable-next-line @typescript-eslint/no-explicit-any
     async remove(
         guild: string,
         key: string,
+        // eslint-disable-next-line @typescript-eslint/no-explicit-any
         value: any,
         innerKey?: string | null
     ) {
diff --git a/src/utils/generateEmojiEmbed.ts b/src/utils/generateEmojiEmbed.ts
index c1de60f..69058ae 100644
--- a/src/utils/generateEmojiEmbed.ts
+++ b/src/utils/generateEmojiEmbed.ts
@@ -11,7 +11,6 @@
     _title = "";
     _emoji: string | null = null;
 
-    // eslint-disable-next-line @typescript-eslint/ban-ts-comment
     // @ts-expect-error
     // This *is* meant to be an accessor rather than a property
     override get title() {
