From 80a40cd9dca59ad4f07d8044a3e7602ee7d7679e Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 5 Nov 2020 20:49:49 +0100 Subject: [PATCH] Fall back color for displayHexColor Signed-off-by: loicbersier --- event/listeners/message.js | 2 +- event/listeners/messageReactionAdd.js | 4 ++-- event/listeners/messageReactionRemove.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/event/listeners/message.js b/event/listeners/message.js index 9d4e7fc..5ea568a 100644 --- a/event/listeners/message.js +++ b/event/listeners/message.js @@ -67,7 +67,7 @@ class messageListener extends Listener { censoredMessage = censoredMessage.replace(regex, '█'.repeat(bannedWords[i].get('word').length)); } let Embed = this.client.util.embed() - .setColor(message.member.displayHexColor) + .setColor(message.member ? message.member.displayHexColor : 'NAVY') .setAuthor(message.author.username, message.author.displayAvatarURL()) .setDescription(censoredMessage); diff --git a/event/listeners/messageReactionAdd.js b/event/listeners/messageReactionAdd.js index 67c2002..3dbbe7a 100644 --- a/event/listeners/messageReactionAdd.js +++ b/event/listeners/messageReactionAdd.js @@ -95,7 +95,7 @@ class MessageReactionAddListener extends Listener { description = ''; let Embed = client.util.embed() - .setColor(reaction.message.member.displayHexColor) + .setColor(reaction.message.member ? reaction.message.member.displayHexColor : 'NAVY') .setAuthor(reaction.message.author.username, reaction.message.author.displayAvatarURL()) .addField('Jump to', `[message](https://discordapp.com/channels/${reaction.message.guild.id}/${reaction.message.channel.id}/${reaction.message.id})`, true) .addField('Channel', reaction.message.channel, true) @@ -119,7 +119,7 @@ class MessageReactionAddListener extends Listener { } let Embed = client.util.embed() - .setColor(reaction.message.member.displayHexColor) + .setColor(reaction.message.member ? reaction.message.member.displayHexColor : 'NAVY') .setAuthor(reaction.message.author.username, reaction.message.author.displayAvatarURL()) .addField('Jump to', `[message](https://discordapp.com/channels/${reaction.message.guild.id}/${reaction.message.channel.id}/${reaction.message.id})`, true) .addField('Channel', reaction.message.channel, true) diff --git a/event/listeners/messageReactionRemove.js b/event/listeners/messageReactionRemove.js index feaf587..21a1e19 100644 --- a/event/listeners/messageReactionRemove.js +++ b/event/listeners/messageReactionRemove.js @@ -92,7 +92,7 @@ class messageReactionRemoveListener extends Listener { description = ''; let Embed = client.util.embed() - .setColor(reaction.message.member.displayHexColor) + .setColor(reaction.message.member ? reaction.message.member.displayHexColor : 'NAVY') .setAuthor(reaction.message.author.username, reaction.message.author.displayAvatarURL()) .addField('Jump to', `[message](https://discordapp.com/channels/${reaction.message.guild.id}/${reaction.message.channel.id}/${reaction.message.id})`, true) .addField('Channel', reaction.message.channel, true)