From 26d6b434cfb25cf1095434dfe371378c13897736 Mon Sep 17 00:00:00 2001 From: "Andrew Morgan andrew@amorgan.xyz" <andrew@amorgan.xyz> Date: Thu, 17 May 2018 12:53:05 +0200 Subject: [PATCH] Prevent non-edits from producing edit messages. --- src/bot.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bot.ts b/src/bot.ts index 7b80856..e12baed 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -588,6 +588,11 @@ export class DiscordBot { } private async OnUpdate(oldMsg: Discord.Message, newMsg: Discord.Message) { + // Check if an edit was actually made + if (oldMsg.toString() === newMsg.toString()) { + return; + } + // Create a new edit message using the old and new message contents let editedMsg = await this.msgProcessor.FormatEdit(oldMsg, newMsg); -- GitLab