diff --git a/src/events/messageEdit.ts b/src/events/messageEdit.ts
index 318b0ef..ec713a2 100644
--- a/src/events/messageEdit.ts
+++ b/src/events/messageEdit.ts
@@ -1,44 +1,46 @@
 export const event = 'messageUpdate'
 
 export async function callback(client, oldMessage, newMessage) {
-    if (newMessage.author.id == client.user.id) return;
-	const { log, NucleusColors, entry, renderUser, renderDelta, renderNumberDelta, renderChannel } = newMessage.channel.client.logger
-    newMessage.reference = newMessage.reference || {}
-    let newContent = newMessage.cleanContent.replaceAll("`", "‘")
-    let oldContent = oldMessage.cleanContent.replaceAll("`", "‘")
-    if (newContent == oldContent) return;
-    if (newContent.length > 256) newContent = newContent.substring(0, 253) + '...'
-    if (oldContent.length > 256) oldContent = oldContent.substring(0, 253) + '...'
-    let data = {
-        meta: {
-            type: 'messageUpdate',
-            displayName: 'Message Edited',
-            calculateType: 'messageUpdate',
-            color: NucleusColors.yellow,
-            emoji: 'MESSAGE.EDIT',
-            timestamp: newMessage.editedTimestamp
-        },
-        separate: {
-            start: (oldContent ? `**Before:**\n\`\`\`\n${oldContent}\n\`\`\`\n` : '**Before:** *Message had no content*\n') +
-                   (newContent ? `**After:**\n\`\`\`\n${newContent}\n\`\`\`` : '**After:** *Message had no content*'),
-            end: `[[Jump to message]](${newMessage.url})`
-        },
-        list: {
-            id: entry(newMessage.id, `\`${newMessage.id}\``),
-            sentBy: entry(newMessage.author.id, renderUser(newMessage.author)),
-            sentIn: entry(newMessage.channel.id, renderChannel(newMessage.channel)),
-            sent: entry(new Date(newMessage.createdTimestamp), renderDelta(new Date(newMessage.createdTimestamp))),
-            edited: entry(new Date(newMessage.editedTimestamp), renderDelta(new Date(newMessage.editedTimestamp))),
-            mentions: renderNumberDelta(oldMessage.mentions.users.size, newMessage.mentions.users.size),
-            attachments: renderNumberDelta(oldMessage.attachments.size, newMessage.attachments.size),
-            repliedTo: entry(
-                newMessage.reference.messageId || null,
-                newMessage.reference.messageId ? `[[Jump to message]](https://discord.com/channels/${newMessage.guild.id}/${newMessage.channel.id}/${newMessage.reference.messageId})` : "None"
-            )
-        },
-        hidden: {
-            guild: newMessage.channel.guild.id
+    try {
+        if (newMessage.author.id == client.user.id) return;
+        const { log, NucleusColors, entry, renderUser, renderDelta, renderNumberDelta, renderChannel } = newMessage.channel.client.logger
+        newMessage.reference = newMessage.reference || {}
+        let newContent = newMessage.cleanContent.replaceAll("`", "‘")
+        let oldContent = oldMessage.cleanContent.replaceAll("`", "‘")
+        if (newContent == oldContent) return;
+        if (newContent.length > 256) newContent = newContent.substring(0, 253) + '...'
+        if (oldContent.length > 256) oldContent = oldContent.substring(0, 253) + '...'
+        let data = {
+            meta: {
+                type: 'messageUpdate',
+                displayName: 'Message Edited',
+                calculateType: 'messageUpdate',
+                color: NucleusColors.yellow,
+                emoji: 'MESSAGE.EDIT',
+                timestamp: newMessage.editedTimestamp
+            },
+            separate: {
+                start: (oldContent ? `**Before:**\n\`\`\`\n${oldContent}\n\`\`\`\n` : '**Before:** *Message had no content*\n') +
+                    (newContent ? `**After:**\n\`\`\`\n${newContent}\n\`\`\`` : '**After:** *Message had no content*'),
+                end: `[[Jump to message]](${newMessage.url})`
+            },
+            list: {
+                id: entry(newMessage.id, `\`${newMessage.id}\``),
+                sentBy: entry(newMessage.author.id, renderUser(newMessage.author)),
+                sentIn: entry(newMessage.channel.id, renderChannel(newMessage.channel)),
+                sent: entry(new Date(newMessage.createdTimestamp), renderDelta(new Date(newMessage.createdTimestamp))),
+                edited: entry(new Date(newMessage.editedTimestamp), renderDelta(new Date(newMessage.editedTimestamp))),
+                mentions: renderNumberDelta(oldMessage.mentions.users.size, newMessage.mentions.users.size),
+                attachments: renderNumberDelta(oldMessage.attachments.size, newMessage.attachments.size),
+                repliedTo: entry(
+                    newMessage.reference.messageId || null,
+                    newMessage.reference.messageId ? `[[Jump to message]](https://discord.com/channels/${newMessage.guild.id}/${newMessage.channel.id}/${newMessage.reference.messageId})` : "None"
+                )
+            },
+            hidden: {
+                guild: newMessage.channel.guild.id
+            }
         }
-    }
-    log(data, client);
+        log(data, client);
+    } catch {}
 }
