Browse Source

Fix if statement to check if there are message attachments on edit

master
Abheek Dhawan 4 years ago
parent
commit
a7994d53af
  1. 2
      bot.js

2
bot.js

@ -726,7 +726,7 @@ client.on('messageUpdate', (originalMessage, editedMessage) => {
if (editedMessage !== originalMessage) { if (editedMessage !== originalMessage) {
editEmbed.addField("Message", `\`\`\`diff\n+${originalMessage}\n+${editedMessage}\`\`\``) 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(' • ')) editEmbed.addField("Attachments", editedMessage.attachments.array().map(a =>`[${a.name}](${a.url})`).join(' • '))
} }
collection.findOne({ guild_id: editedMessage.guild.id }, (error, result) => { collection.findOne({ guild_id: editedMessage.guild.id }, (error, result) => {

Loading…
Cancel
Save