From a7994d53af7a1eb02d688a92835ec067242cf344 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sun, 4 Apr 2021 22:39:22 -0500 Subject: [PATCH] Fix if statement to check if there are message attachments on edit --- bot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.js b/bot.js index 5b02dea..90ab9a8 100644 --- a/bot.js +++ b/bot.js @@ -726,7 +726,7 @@ client.on('messageUpdate', (originalMessage, editedMessage) => { if (editedMessage !== originalMessage) { editEmbed.addField("Message", `\`\`\`diff\n+${originalMessage}\n+${editedMessage}\`\`\``) } - if (editedMessage.attachments) { + if (editedMessage.attachments.array().length < 1) { editEmbed.addField("Attachments", editedMessage.attachments.array().map(a =>`[${a.name}](${a.url})`).join(' • ')) } collection.findOne({ guild_id: editedMessage.guild.id }, (error, result) => {