Browse Source

Fix null errors for message deletes (again)

master
Abheek Dhawan 4 years ago
parent
commit
77b9c7db6c
  1. 6
      index.js

6
index.js

@ -22,10 +22,12 @@ client.on('messageDelete', message => {
const messageAvatar = message.author.avatarURL(); const messageAvatar = message.author.avatarURL();
const messageID = message.id; const messageID = message.id;
let messageAuthor; let messageAuthor;
if (message.author) { if (message) {
messageAuthor = message.author.tag; messageAuthor = message.author.tag;
} else { } else {
messageAuthor = "Someone else deleted this message" messageAuthor = "Someone else deleted this message";
messageContent = "Unknown";
messageID = "Unknown";
} }
const deleteEmbed = new Discord.MessageEmbed() const deleteEmbed = new Discord.MessageEmbed()
.setTitle('Message Deleted') .setTitle('Message Deleted')

Loading…
Cancel
Save