Development (#11)
We need this NOW.
---------
Co-authored-by: PineaFan <ash@pinea.dev>
Co-authored-by: pineafan <pineapplefanyt@gmail.com>
Co-authored-by: PineappleFan <PineaFan@users.noreply.github.com>
Co-authored-by: Skyler <skyler3665@gmail.com>
diff --git a/src/events/messageEdit.ts b/src/events/messageEdit.ts
index 20624fe..f5a28a4 100644
--- a/src/events/messageEdit.ts
+++ b/src/events/messageEdit.ts
@@ -6,8 +6,10 @@
export async function callback(client: NucleusClient, oldMessage: Message, newMessage: Message) {
if (newMessage.author.id === client.user!.id) return;
+ if (newMessage.author.bot) return;
if (!newMessage.guild) return;
- const { log, 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;
let newContent = newMessage.cleanContent.replaceAll("`", "‘");
let oldContent = oldMessage.cleanContent.replaceAll("`", "‘");
@@ -18,7 +20,8 @@
if (config) {
attachmentJump = ` [[View attachments]](${config})`;
}
- if (newContent === oldContent && newMessage.attachments.size === oldMessage.attachments.size) {
+ if (newMessage.crosspostable !== oldMessage.crosspostable) {
+ if(!await isLogging(newMessage.guild.id, "messageAnnounce")) return;
if (!replyTo) {
const data = {
meta: {
@@ -27,7 +30,7 @@
calculateType: "messageAnnounce",
color: NucleusColors.yellow,
emoji: "MESSAGE.CREATE",
- timestamp: newMessage.editedTimestamp
+ timestamp: newMessage.editedTimestamp ?? Date.now()
},
separate: {
end: `[[Jump to message]](${newMessage.url})`
@@ -57,6 +60,7 @@
return log(data);
}
}
+ if (!await isLogging(newMessage.guild.id, "messageUpdate")) return;
if (!newMessage.editedTimestamp) {
return;
}