Browse Source

Add author field for messageUpdate embed

master
Abheek Dhawan 4 years ago
parent
commit
42f92cdc25
  1. 1
      bot.js

1
bot.js

@ -716,6 +716,7 @@ client.on('messageUpdate', (originalMessage, editedMessage) => {
const editEmbed = new Discord.MessageEmbed() const editEmbed = new Discord.MessageEmbed()
.setTitle("Message Edited") .setTitle("Message Edited")
.setURL(editedMessage.url) .setURL(editedMessage.url)
.setAuthor(editedMessage.author ? editedMessage.author.tag : "Unknown", editedMessage.author ? editedMessage.author.avatarURL() : client.user.defaultAvatarURL)
.addField("Author", editedMessage.author.tag) .addField("Author", editedMessage.author.tag)
.addField("Message", `<< ${originalMessage}\n>> ${editedMessage}`) .addField("Message", `<< ${originalMessage}\n>> ${editedMessage}`)
.setThumbnail(editedMessage.author.avatarURL()) .setThumbnail(editedMessage.author.avatarURL())

Loading…
Cancel
Save