fixing event logs
diff --git a/src/events/messageEdit.ts b/src/events/messageEdit.ts
index d491641..f5a28a4 100644
--- a/src/events/messageEdit.ts
+++ b/src/events/messageEdit.ts
@@ -8,7 +8,8 @@
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("`", "‘");
@@ -20,6 +21,7 @@
attachmentJump = ` [[View attachments]](${config})`;
}
if (newMessage.crosspostable !== oldMessage.crosspostable) {
+ if(!await isLogging(newMessage.guild.id, "messageAnnounce")) return;
if (!replyTo) {
const data = {
meta: {
@@ -28,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})`
@@ -58,6 +60,7 @@
return log(data);
}
}
+ if (!await isLogging(newMessage.guild.id, "messageUpdate")) return;
if (!newMessage.editedTimestamp) {
return;
}