diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts
index 7e4a52f..f690885 100644
--- a/src/events/messageCreate.ts
+++ b/src/events/messageCreate.ts
@@ -1,13 +1,6 @@
 // @ts-expect-error
 import { HaikuClient } from "jshaiku";
-import {
-    LinkCheck,
-    MalwareCheck,
-    NSFWCheck,
-    SizeCheck,
-    TestString,
-    TestImage
-} from "../reflex/scanners.js";
+import { LinkCheck, MalwareCheck, NSFWCheck, SizeCheck, TestString, TestImage } from "../reflex/scanners.js";
 import logAttachment from "../premium/attachmentLogs.js";
 import createLogException from "../utils/createLogException.js";
 import getEmojiByName from "../utils/getEmojiByName.js";
@@ -27,14 +20,7 @@
         console.log(e);
     }
 
-    const {
-        log,
-        NucleusColors,
-        entry,
-        renderUser,
-        renderDelta,
-        renderChannel
-    } = client.logger;
+    const { log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
 
     const fileNames = await logAttachment(message);
 
@@ -43,9 +29,7 @@
     const filter = getEmojiByName("ICONS.FILTER");
     let attachmentJump = "";
     if (config.logging.attachments.saved[message.channel.id + message.id]) {
-        attachmentJump = ` [[View attachments]](${
-            config.logging.attachments.saved[message.channel.id + message.id]
-        })`;
+        attachmentJump = ` [[View attachments]](${config.logging.attachments.saved[message.channel.id + message.id]})`;
     }
     const list = {
         messageId: entry(message.id, `\`${message.id}\``),
@@ -53,10 +37,7 @@
         sentIn: entry(message.channel.id, renderChannel(message.channel)),
         deleted: entry(new Date().getTime(), renderDelta(new Date().getTime())),
         mentions: message.mentions.users.size,
-        attachments: entry(
-            message.attachments.size,
-            message.attachments.size + attachmentJump
-        ),
+        attachments: entry(message.attachments.size, message.attachments.size + attachmentJump),
         repliedTo: entry(
             message.reference ? message.reference.messageId : null,
             message.reference
@@ -66,25 +47,14 @@
     };
 
     if (config.filters.invite.enabled) {
-        if (
-            !config.filters.invite.allowed.channels.includes(message.channel.id)
-        ) {
-            if (
-                /(?:https?:\/\/)?discord(?:app)?\.(?:com\/invite|gg)\/[a-zA-Z0-9]+\/?/.test(
-                    content
-                )
-            ) {
-                createLogException(
-                    message.guild.id,
-                    message.channel.id,
-                    message.id
-                );
+        if (!config.filters.invite.allowed.channels.includes(message.channel.id)) {
+            if (/(?:https?:\/\/)?discord(?:app)?\.(?:com\/invite|gg)\/[a-zA-Z0-9]+\/?/.test(content)) {
+                createLogException(message.guild.id, message.channel.id, message.id);
                 message.delete();
                 const data = {
                     meta: {
                         type: "messageDelete",
-                        displayName:
-                            "Message Deleted (Automated, Contained Invite)",
+                        displayName: "Message Deleted (Automated, Contained Invite)",
                         calculateType: "autoModeratorDeleted",
                         color: NucleusColors.red,
                         emoji: "MESSAGE.DELETE",
@@ -94,9 +64,7 @@
                         start:
                             filter +
                             " Contained invite\n\n" +
-                            (content
-                                ? `**Message:**\n\`\`\`${content}\`\`\``
-                                : "**Message:** *Message had no content*")
+                            (content ? `**Message:**\n\`\`\`${content}\`\`\`` : "**Message:** *Message had no content*")
                     },
                     list: list,
                     hidden: {
@@ -111,21 +79,13 @@
     if (fileNames.files.length > 0) {
         for (const element of fileNames.files) {
             const url = element.url ? element.url : element.local;
-            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)) {
                 if (
                     config.filters.images.NSFW &&
-                    !(message.channel instanceof ThreadChannel
-                        ? message.channel.parent?.nsfw
-                        : message.channel.nsfw)
+                    !(message.channel instanceof ThreadChannel ? message.channel.parent?.nsfw : message.channel.nsfw)
                 ) {
                     if (await NSFWCheck(url)) {
-                        createLogException(
-                            message.guild.id,
-                            message.channel.id,
-                            message.id
-                        );
+                        createLogException(message.guild.id, message.channel.id, message.id);
                         await message.delete();
                         const data = {
                             meta: {
@@ -160,11 +120,7 @@
                         config.filters.wordFilter.words.strict
                     );
                     if (check !== null) {
-                        createLogException(
-                            message.guild.id,
-                            message.channel.id,
-                            message.id
-                        );
+                        createLogException(message.guild.id, message.channel.id, message.id);
                         await message.delete();
                         const data = {
                             meta: {
@@ -194,11 +150,7 @@
                 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
-                            );
+                            createLogException(message.guild.id, message.channel.id, message.id);
                             await message.delete();
                             const data = {
                                 meta: {
@@ -229,11 +181,7 @@
             }
             if (config.filters.malware) {
                 if (!(await MalwareCheck(url))) {
-                    createLogException(
-                        message.guild.id,
-                        message.channel.id,
-                        message.id
-                    );
+                    createLogException(message.guild.id, message.channel.id, message.id);
                     await message.delete();
                     const data = {
                         meta: {
@@ -280,9 +228,7 @@
                 start:
                     filter +
                     ` Link filtered as ${linkDetectionTypes[0]?.toLowerCase()}\n\n` +
-                    (content
-                        ? `**Message:**\n\`\`\`${content}\`\`\``
-                        : "**Message:** *Message had no content*")
+                    (content ? `**Message:**\n\`\`\`${content}\`\`\`` : "**Message:** *Message had no content*")
             },
             list: list,
             hidden: {
@@ -299,11 +245,7 @@
             config.filters.wordFilter.words.strict
         );
         if (check !== null) {
-            createLogException(
-                message.guild.id,
-                message.channel.id,
-                message.id
-            );
+            createLogException(message.guild.id, message.channel.id, message.id);
             await message.delete();
             const data = {
                 meta: {
@@ -318,9 +260,7 @@
                     start:
                         filter +
                         " Message contained filtered word\n\n" +
-                        (content
-                            ? `**Message:**\n\`\`\`${content}\`\`\``
-                            : "**Message:** *Message had no content*")
+                        (content ? `**Message:**\n\`\`\`${content}\`\`\`` : "**Message:** *Message had no content*")
                 },
                 list: list,
                 hidden: {
@@ -342,9 +282,7 @@
                 timestamp: new Date().getTime()
             },
             separate: {
-                start: content
-                    ? `**Message:**\n\`\`\`${content}\`\`\``
-                    : "**Message:** *Message had no content*"
+                start: content ? `**Message:**\n\`\`\`${content}\`\`\`` : "**Message:** *Message had no content*"
             },
             list: list,
             hidden: {
@@ -356,11 +294,7 @@
     if (config.filters.pings.roles) {
         for (const roleId in message.mentions.roles) {
             if (!config.filters.pings.allowed.roles.includes(roleId)) {
-                createLogException(
-                    message.guild.id,
-                    message.channel.id,
-                    message.id
-                );
+                createLogException(message.guild.id, message.channel.id, message.id);
                 await message.delete();
                 const data = {
                     meta: {
@@ -385,10 +319,7 @@
             }
         }
     }
-    if (
-        message.mentions.users.size >= config.filters.pings.mass &&
-        config.filters.pings.mass
-    ) {
+    if (message.mentions.users.size >= config.filters.pings.mass && config.filters.pings.mass) {
         createLogException(message.guild.id, message.channel.id, message.id);
         await message.delete();
         const data = {
@@ -401,9 +332,7 @@
                 timestamp: new Date().getTime()
             },
             separate: {
-                start: content
-                    ? `**Message:**\n\`\`\`${content}\`\`\``
-                    : "**Message:** *Message had no content*"
+                start: content ? `**Message:**\n\`\`\`${content}\`\`\`` : "**Message:** *Message had no content*"
             },
             list: list,
             hidden: {
