From fa9baf37a405ce57f5e1c3717c0c4f43640ca349 Mon Sep 17 00:00:00 2001 From: Muril-o Date: Thu, 26 Jan 2023 15:13:36 -0300 Subject: [PATCH] fix: message update should only run when diff in content --- src/events/messageUpdate.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/events/messageUpdate.ts b/src/events/messageUpdate.ts index d91eb5c..22b1ae4 100644 --- a/src/events/messageUpdate.ts +++ b/src/events/messageUpdate.ts @@ -7,7 +7,14 @@ export const event: Event = { once: false, async handle(oldMessage: Message, newMessage: Message) { // We dont listen to edits in interaction responses or dm messages - if (newMessage.interaction || !newMessage.inGuild() || newMessage.author.bot) return; + // Additionally we don't listen to messages with same content + if ( + newMessage.interaction || + !newMessage.inGuild() || + newMessage.author.bot || + oldMessage.content === newMessage.content + ) + return; if (oldMessage.partial) { try {