From 6e5ca1fb9ea534a8442dd81e4f6d020cf7fb81b5 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sun, 4 Apr 2021 22:12:45 -0500 Subject: [PATCH] Fix attachments on message edit --- bot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.js b/bot.js index 5410205..ed8a7bf 100644 --- a/bot.js +++ b/bot.js @@ -726,8 +726,8 @@ client.on('messageUpdate', (originalMessage, editedMessage) => { if (editedMessage !== originalMessage) { editEmbed.addField("Message", `<< ${originalMessage}\n>> ${editedMessage}`) } - if (editedMessage.attachments) { - editEmbed.addField("Attachments", editedMessage.attachments.array().map(`[${a.name}](${a.url})`).join(' • ')) + if (editedMessage.attachments.array().length) { + editEmbed.addField("Attachments", editedMessage.attachments.array().map(a => `[${a.name}](${a.url})`).join(' • ')) } collection.findOne({ guild_id: editedMessage.guild.id }, (error, result) => { if (error) {