From 77b9c7db6c7755b52dcb1f14bca259b4af9849e1 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Wed, 31 Mar 2021 15:09:20 -0500 Subject: [PATCH] Fix null errors for message deletes (again) --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index b30daba..5a3886f 100644 --- a/index.js +++ b/index.js @@ -22,10 +22,12 @@ client.on('messageDelete', message => { const messageAvatar = message.author.avatarURL(); const messageID = message.id; let messageAuthor; - if (message.author) { + if (message) { messageAuthor = message.author.tag; } else { - messageAuthor = "Someone else deleted this message" + messageAuthor = "Someone else deleted this message"; + messageContent = "Unknown"; + messageID = "Unknown"; } const deleteEmbed = new Discord.MessageEmbed() .setTitle('Message Deleted')