Fall back color for displayHexColor

Signed-off-by: loicbersier <loic.bersier1@gmail.com>
This commit is contained in:
loicbersier 2020-11-05 20:49:49 +01:00
parent 2fefe31242
commit 80a40cd9dc
3 changed files with 4 additions and 4 deletions

View file

@ -67,7 +67,7 @@ class messageListener extends Listener {
censoredMessage = censoredMessage.replace(regex, '█'.repeat(bannedWords[i].get('word').length)); censoredMessage = censoredMessage.replace(regex, '█'.repeat(bannedWords[i].get('word').length));
} }
let Embed = this.client.util.embed() let Embed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setAuthor(message.author.username, message.author.displayAvatarURL()) .setAuthor(message.author.username, message.author.displayAvatarURL())
.setDescription(censoredMessage); .setDescription(censoredMessage);

View file

@ -95,7 +95,7 @@ class MessageReactionAddListener extends Listener {
description = ''; description = '';
let Embed = client.util.embed() 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()) .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('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) .addField('Channel', reaction.message.channel, true)
@ -119,7 +119,7 @@ class MessageReactionAddListener extends Listener {
} }
let Embed = client.util.embed() 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()) .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('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) .addField('Channel', reaction.message.channel, true)

View file

@ -92,7 +92,7 @@ class messageReactionRemoveListener extends Listener {
description = ''; description = '';
let Embed = client.util.embed() 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()) .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('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) .addField('Channel', reaction.message.channel, true)