New edit and delete logs
diff --git a/src/events/messageEdit.ts b/src/events/messageEdit.ts
index f61a873..35de994 100644
--- a/src/events/messageEdit.ts
+++ b/src/events/messageEdit.ts
@@ -3,6 +3,7 @@
import type Discord from "discord.js";
import * as diff from "diff";
import addPlural from "../utils/plurals.js";
+import { imageDataEasterEgg } from "../utils/defaults.js";
export const event = "messageUpdate";
@@ -10,16 +11,8 @@
if (newMessage.author.id === client.user!.id) return;
if (newMessage.author.bot) return;
if (!newMessage.guild) return;
- const {
- log,
- isLogging,
- NucleusColors,
- entry,
- renderUser,
- renderDelta,
- renderNumberDelta,
- renderChannel
- } = client.logger;
+ const { log, isLogging, NucleusColors, entry, renderUser, renderDelta, renderNumberDelta, renderChannel } =
+ client.logger;
const replyTo: MessageReference | null = newMessage.reference;
const newContent = newMessage.cleanContent.replaceAll("`", "‘");
const oldContent = oldMessage.cleanContent.replaceAll("`", "‘");
@@ -72,14 +65,15 @@
return;
}
const differences = diff.diffChars(oldContent, newContent);
- const charsAdded = (differences.filter((d) => d.added).map((d) => d.count)).reduce((a, b) => a! + b!, 0)!;
- const charsRemoved = (differences.filter((d) => d.removed).map((d) => d.count)).reduce((a, b) => a! + b!, 0)!;
- const imageData = JSON.stringify({data: differences, extra: "The image in this embed contains data about the below log.\n" +
- "It isn't designed to be read by humans, but you can decode " +
- "it with any base64 decoder, and then read it as JSON.\n" +
- "We use base 64 to get around people using virus tests and the file being blocked, and an image to have the embed hidden (files can't be suppressed)\n" +
- "If you've got to this point and are reading this hidden message, you should come and work with us " +
- "at https://discord.gg/w35pXdrxKW (Internal development server) and let us know how you got here."}, null, 2)
+ const charsAdded = differences
+ .filter((d) => d.added)
+ .map((d) => d.count)
+ .reduce((a, b) => a! + b!, 0)!;
+ const charsRemoved = differences
+ .filter((d) => d.removed)
+ .map((d) => d.count)
+ .reduce((a, b) => a! + b!, 0)!;
+ const imageData = JSON.stringify({ data: differences, extra: imageDataEasterEgg }, null, 2);
const data = {
meta: {
type: "messageUpdate",
@@ -88,7 +82,7 @@
color: NucleusColors.yellow,
emoji: "MESSAGE.EDIT",
timestamp: newMessage.editedTimestamp,
- buttons: [{ buttonText: "View Changes", buttonStyle: ButtonStyle.Secondary, buttonId: `log:edit` }],
+ buttons: [{ buttonText: "View Changes", buttonStyle: ButtonStyle.Secondary, buttonId: `log:message.edit` }],
imageData: imageData
},
separate: {