From 6537fed0d509268befee43988f55fc555db60d79 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sat, 3 Apr 2021 20:24:59 -0500 Subject: [PATCH] Set default message author and avatar URL if it isn't cached --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 135beef..6812987 100644 --- a/index.js +++ b/index.js @@ -761,7 +761,7 @@ client.on('messageReactionAdd', (messageReaction, user) => { const kulboardEmbed = new Discord.MessageEmbed() .setTitle("Very kül message") .setURL(messageReaction.message.url) - .setAuthor(messageReaction.message.author.tag, messageReaction.message.author.avatarURL()) + .setAuthor(messageReaction.message.author ? messageReaction.message.author.tag : "Unknown: click on the link to find out", messageReaction.message.author ? messageReaction.message.author.avatarURL() : client.user.defaultAvatarURL) .addField("Message", messageContent) .addField("Channel", messageReaction.message.channel) .setFooter("Message ID: " + messageReaction.message.id)