diff --git a/src/events/messageEdit.ts b/src/events/messageEdit.ts
index bca652e..6719cc3 100644
--- a/src/events/messageEdit.ts
+++ b/src/events/messageEdit.ts
@@ -1,5 +1,5 @@
 import type { NucleusClient } from "../utils/client.js";
-import type { Message, MessageReference } from "discord.js";
+import { AttachmentBuilder, Message, MessageReference } from "discord.js";
 import type Discord from "discord.js";
 import * as diff from "diff";
 
@@ -63,68 +63,88 @@
         return;
     }
     const differences = diff.diffChars(oldContent, newContent);
-    console.log(differences);
-    let contentEdit = "";
-    if (differences.map((d) => (d.added || d.removed ? 1 : 0)).filter((f) => f === 1).length > 0) {
-        const green = "\x1B[36m";
-        const red = "\x1B[41m";
-        const skipped = "\x1B[40;33m";
-        const reset = "\x1B[0m";
-        const bold = "\x1B[1m";
-        const cutoff = 20;
-        differences.forEach((part) => {
-            if (!part.added && !part.removed && part.value.length > cutoff) {
-                contentEdit +=
-                    reset +
-                    part.value.slice(0, cutoff / 2) +
-                    skipped +
-                    `(${part.value.length - cutoff} more)` +
-                    reset +
-                    part.value.slice(-(cutoff / 2));
-            } else {
-                if (part.added || part.removed) {
-                    part.value = part.value.replaceAll(" ", "▁");
-                }
-                contentEdit += (part.added ? green : part.removed ? red : "") + part.value + reset;
-            }
-        });
-        contentEdit = contentEdit.slice(0, 2000);
-        contentEdit += `\n\n${bold}Key:${reset} ${green}Added${reset} | ${red}Removed${reset} | ${skipped}Skipped${reset}`;
-        const data = {
-            meta: {
-                type: "messageUpdate",
-                displayName: "Message Edited",
-                calculateType: "messageUpdate",
-                color: NucleusColors.yellow,
-                emoji: "MESSAGE.EDIT",
-                timestamp: newMessage.editedTimestamp
-            },
-            separate: {
-                start: `\`\`\`ansi\n${contentEdit}\`\`\``,
-                end: `[[Jump to message]](${newMessage.url})`
-            },
-            list: {
-                messageId: entry(newMessage.id, `\`${newMessage.id}\``),
-                sentBy: entry(newMessage.author.id, renderUser(newMessage.author)),
-                sentIn: entry(newMessage.channel.id, renderChannel(newMessage.channel as Discord.GuildBasedChannel)),
-                sent: entry(newMessage.createdTimestamp, renderDelta(newMessage.createdTimestamp)),
-                edited: entry(newMessage.editedTimestamp, renderDelta(newMessage.editedTimestamp)),
-                mentions: renderNumberDelta(oldMessage.mentions.users.size, newMessage.mentions.users.size),
-                attachments: entry(
-                    renderNumberDelta(oldMessage.attachments.size, newMessage.attachments.size),
-                    renderNumberDelta(oldMessage.attachments.size, newMessage.attachments.size) + attachmentJump
-                ),
-                repliedTo: entry(
-                    replyTo ? replyTo.messageId! : null,
-                    replyTo
-                        ? `[[Jump to message]](https://discord.com/channels/${newMessage.guild.id}/${newMessage.channel.id}/${replyTo.messageId})`
-                        : "None"
-                )
-            },
-            hidden: {
-                guild: newMessage.guild.id
-            }
-        };
-        await log(data);
-    }
+    const green = "\x1B[36m";
+    const red = "\x1B[41m";
+    const skipped = "\x1B[40;33m";
+    const reset = "\x1B[0m";
+    const bold = "\x1B[1m";
+    // console.log(differences);
+    // let contentAdd = "";
+    // let contentRemove = "";
+    // if (differences.map((d) => (d.added || d.removed ? 1 : 0)).filter((f) => f === 1).length > 0) {
+    //     const cutoff = 20;
+    //     differences.forEach((part) => {
+    //         if (!part.added && !part.removed && part.value.length > cutoff) {
+    //             contentAdd +=
+    //                 reset +
+    //                 part.value.slice(0, cutoff / 2) +
+    //                 skipped +
+    //                 `(${part.value.length - cutoff} more)` +
+    //                 reset +
+    //                 part.value.slice(-(cutoff / 2));
+    //             contentRemove +=
+    //                 reset +
+    //                 part.value.slice(0, cutoff / 2) +
+    //                 skipped +
+    //                 `(${part.value.length - cutoff} more)` +
+    //                 reset +
+    //                 part.value.slice(-(cutoff / 2));
+    //         } else {
+    //             if (part.added || part.removed) {
+    //                 part.value = part.value.replaceAll(" ", "▁");
+    //             }
+    //             if (part.added) {
+    //                 contentAdd += green + part.value + reset;
+    //             } else if (part.removed) {
+    //                 contentRemove += red + part.value + reset;
+    //             } else {
+    //                 contentAdd += part.value;
+    //                 contentRemove += part.value;
+    //             }
+    //         }
+    //     });
+    const key = `\n\n${bold}Key:${reset} ${green}Added${reset} | ${red}Removed${reset} | ${skipped}Skipped${reset}`;
+    const data = {
+        meta: {
+            type: "messageUpdate",
+            displayName: "Message Edited",
+            calculateType: "messageUpdate",
+            color: NucleusColors.yellow,
+            emoji: "MESSAGE.EDIT",
+            timestamp: newMessage.editedTimestamp,
+            files: [
+                new AttachmentBuilder(Buffer.from(JSON.stringify(differences)), {
+                    name: "diff.json",
+                    description: "A JSON file containing the differences between the two messages."
+                })
+            ],
+            showDetails: true
+        },
+        separate: {
+            start: `To read the full log press the button below.\n\`\`\`ansi\n${key}\`\`\``,
+            end: `[[Jump to message]](${newMessage.url})`
+        },
+        list: {
+            messageId: entry(newMessage.id, `\`${newMessage.id}\``),
+            sentBy: entry(newMessage.author.id, renderUser(newMessage.author)),
+            sentIn: entry(newMessage.channel.id, renderChannel(newMessage.channel as Discord.GuildBasedChannel)),
+            sent: entry(newMessage.createdTimestamp, renderDelta(newMessage.createdTimestamp)),
+            edited: entry(newMessage.editedTimestamp, renderDelta(newMessage.editedTimestamp)),
+            mentions: renderNumberDelta(oldMessage.mentions.users.size, newMessage.mentions.users.size),
+            attachments: entry(
+                renderNumberDelta(oldMessage.attachments.size, newMessage.attachments.size),
+                renderNumberDelta(oldMessage.attachments.size, newMessage.attachments.size) + attachmentJump
+            ),
+            repliedTo: entry(
+                replyTo ? replyTo.messageId! : null,
+                replyTo
+                    ? `[[Jump to message]](https://discord.com/channels/${newMessage.guild.id}/${newMessage.channel.id}/${replyTo.messageId})`
+                    : "None"
+            )
+        },
+        hidden: {
+            guild: newMessage.guild.id
+        }
+    };
+    await log(data);
 }
