Fall back color for displayHexColor

Signed-off-by: loicbersier <loic.bersier1@gmail.com>
akairo
loicbersier 4 years ago
parent 2fefe31242
commit 80a40cd9dc

@ -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);

@ -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)

@ -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)

Loading…
Cancel
Save