From 630248d9eaaa2c760240c058a15bc619432c909e Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 2 Nov 2019 00:54:40 +0100 Subject: [PATCH] Make embed use rank color --- commands/fun/4chan.js | 2 +- commands/fun/reddit.js | 2 +- commands/general/advice.js | 2 +- commands/minigame/guess.js | 2 +- commands/utility/about.js | 2 +- commands/utility/donate.js | 2 +- commands/utility/help.js | 4 ++-- commands/utility/musicMatch.js | 2 +- commands/utility/seebannedword.js | 2 +- commands/utility/seetag.js | 6 +++--- commands/utility/server.js | 2 +- commands/utility/stats.js | 2 +- commands/utility/translate.js | 2 +- commands/utility/updoot.js | 2 +- event/listeners/message.js | 2 +- 15 files changed, 18 insertions(+), 18 deletions(-) diff --git a/commands/fun/4chan.js b/commands/fun/4chan.js index a97ea39e..65cab60b 100644 --- a/commands/fun/4chan.js +++ b/commands/fun/4chan.js @@ -62,7 +62,7 @@ class FourchanCommand extends Command { } const FourchanEmbed = new MessageEmbed() - .setColor('#ff9900') + .setColor(message.member.displayHexColor) .setTitle(title) .setDescription(htmlToText.fromString(description)) .setImage(`https://i.4cdn.org/${args.board}/${response.threads[i].posts[0].tim}${response.threads[i].posts[0].ext}`) diff --git a/commands/fun/reddit.js b/commands/fun/reddit.js index 08928ccc..11dbb1be 100644 --- a/commands/fun/reddit.js +++ b/commands/fun/reddit.js @@ -43,7 +43,7 @@ class RedditCommand extends Command { if (response.data.children[i].data.over_18 == true && !message.channel.nsfw) return message.channel.send('No nsfw'); const redditEmbed = new MessageEmbed() - .setColor('#ff9900') + .setColor(message.member.displayHexColor) .setTitle(response.data.children[i].data.title) .setDescription(response.data.children[i].data.selftext) .setURL('https://reddit.com' + response.data.children[i].data.permalink) diff --git a/commands/general/advice.js b/commands/general/advice.js index c4fd9d78..72f7a288 100644 --- a/commands/general/advice.js +++ b/commands/general/advice.js @@ -20,7 +20,7 @@ class AdviceCommand extends Command { return response.json(); }).then((response) => { const adviceEmbed = new MessageEmbed() - .setColor('#ff9900') + .setColor(message.member.displayHexColor) .setTitle(response.slip.slip_id) .setDescription(response.slip.advice); diff --git a/commands/minigame/guess.js b/commands/minigame/guess.js index 489bfdbc..81710f7c 100644 --- a/commands/minigame/guess.js +++ b/commands/minigame/guess.js @@ -36,7 +36,7 @@ class guessCommand extends Command { const leaderboard = await guessLeaderboard.findAll({order: ['try']}); let top = []; let leaderboardEmbed = new MessageEmbed() - .setColor('#0099ff') + .setColor(message.member.displayHexColor) .setTitle('Guess leaderboard'); for (let i = 0; i < leaderboard.length; i++) { this.client.users.fetch(leaderboard[i].get('memberID')) diff --git a/commands/utility/about.js b/commands/utility/about.js index 18f2593b..1e300e50 100644 --- a/commands/utility/about.js +++ b/commands/utility/about.js @@ -31,7 +31,7 @@ class aboutCommand extends Command { const aboutEmbed = new MessageEmbed() - .setColor('#ff9900') + .setColor(message.member.displayHexColor) .setAuthor(this.client.user.username, this.client.user.avatarURL()) .setTitle('About me') .setURL('https://gitlab.com/LoicBersier/DiscordBot') diff --git a/commands/utility/donate.js b/commands/utility/donate.js index 1c186040..c14d152e 100644 --- a/commands/utility/donate.js +++ b/commands/utility/donate.js @@ -16,7 +16,7 @@ class donateCommand extends Command { async exec(message) { const Embed = new MessageEmbed() - .setColor('#ff9900') + .setColor(message.member.displayHexColor) .setTitle('Donation link') .setDescription('If you decide to donate, please use the feedback command to let the owner know about it so he can put you in the about and donator command\n[Paypal](https://www.paypal.me/supositware)\n[Patreon](https://www.patreon.com/bePatron?u=15330358)'); diff --git a/commands/utility/help.js b/commands/utility/help.js index 303b9299..4061f4c1 100644 --- a/commands/utility/help.js +++ b/commands/utility/help.js @@ -38,7 +38,7 @@ class HelpCommand extends Command { }, command.description); const embed = this.client.util.embed() - .setColor(0xFFAC33) + .setColor(message.member.displayHexColor) .setTitle(`\`${prefix[0]}${command.aliases[0]} ${description.usage}\``) .addField('Description', description.content) .setFooter(`All the available prefix: ${prefix.join(' | ')}`); @@ -59,7 +59,7 @@ class HelpCommand extends Command { async execCommandList(message) { const embed = this.client.util.embed() - .setColor(0xFFAC33) + .setColor(message.member.displayHexColor) .addField('Command List', [ 'This is a list of commands.', diff --git a/commands/utility/musicMatch.js b/commands/utility/musicMatch.js index 7e196466..358f8984 100644 --- a/commands/utility/musicMatch.js +++ b/commands/utility/musicMatch.js @@ -68,7 +68,7 @@ class musicCommand extends Command { let seconds = time - minutes * 60; const musicEmbed = new MessageEmbed() - .setColor('#ff9900') + .setColor(message.member.displayHexColor) .setTitle('Music found!') .addField('Title', response.results[0].recordings[0].title, true) .addField('Artist', response.results[0].recordings[0].artists[0].name, true) diff --git a/commands/utility/seebannedword.js b/commands/utility/seebannedword.js index 3a28b6b7..ab5b6132 100644 --- a/commands/utility/seebannedword.js +++ b/commands/utility/seebannedword.js @@ -31,7 +31,7 @@ class seebannedwordCommand extends Command { if (list == undefined) return message.channel.send('No word are banned yet.'); const Embed = new MessageEmbed() - .setColor('#ff9900') + .setColor(message.member.displayHexColor) .setTitle('List of banned words') .setDescription(list); diff --git a/commands/utility/seetag.js b/commands/utility/seetag.js index 76c5765d..fea052ed 100644 --- a/commands/utility/seetag.js +++ b/commands/utility/seetag.js @@ -37,7 +37,7 @@ class seetagCommand extends Command { this.client.users.fetch(tagList.dataValues.ownerID) .then(user => { const TagEmbed = new MessageEmbed() - .setColor('#ff9900') + .setColor(message.member.displayHexColor) .setTitle(message.guild.name) .addField('Trigger:', tagList['dataValues']['trigger']) .addField('Response:', tagList['dataValues']['response']) @@ -47,7 +47,7 @@ class seetagCommand extends Command { }) .catch(() => { const TagEmbed = new MessageEmbed() - .setColor('#ff9900') + .setColor(message.member.displayHexColor) .setTitle(message.guild.name) .addField('Trigger:', tagList['dataValues']['trigger']) .addField('Response:', tagList['dataValues']['response']) @@ -69,7 +69,7 @@ class seetagCommand extends Command { let tagList = await Tag.findAll({attributes: ['trigger'], where: {serverID: message.guild.id}}); const tagString = tagList.map(t => t.trigger).join(', ') || 'No tags set.'; const TagEmbed = new MessageEmbed() - .setColor('#ff9900') + .setColor(message.member.displayHexColor) .setTitle('List of tags') .setDescription(tagString) .setFooter('Use this command with the name of the tag to see more info about it!'); diff --git a/commands/utility/server.js b/commands/utility/server.js index cf96c7e5..97e36dd0 100644 --- a/commands/utility/server.js +++ b/commands/utility/server.js @@ -17,7 +17,7 @@ class ServerCommand extends Command { async exec(message) { const addEmbed = new MessageEmbed() - .setColor('#0099ff') + .setColor(message.member.displayHexColor) .setTitle(message.guild.name) .setThumbnail(message.guild.iconURL()) .addField('Number of users', message.guild.members.filter(member => !member.user.bot).size, true) diff --git a/commands/utility/stats.js b/commands/utility/stats.js index eed71064..bb978c2a 100644 --- a/commands/utility/stats.js +++ b/commands/utility/stats.js @@ -51,7 +51,7 @@ class StatsCommand extends Command { } const statsEmbed = new MessageEmbed() - .setColor('#0099ff') + .setColor(message.member.displayHexColor) .setTitle('Bot stats') .setAuthor('Haha yes') .addField('Servers', this.client.guilds.size, true) diff --git a/commands/utility/translate.js b/commands/utility/translate.js index 174380e2..a9fe4d89 100644 --- a/commands/utility/translate.js +++ b/commands/utility/translate.js @@ -48,7 +48,7 @@ class TranslationCommand extends Command { const translationEmbed = new MessageEmbed() - .setColor('#0099ff') + .setColor(message.member.displayHexColor) .setTitle('Asked for the following translation:') .setAuthor(message.author.username) .setDescription(response.text[0]) diff --git a/commands/utility/updoot.js b/commands/utility/updoot.js index 08ef8bbd..84b429d3 100644 --- a/commands/utility/updoot.js +++ b/commands/utility/updoot.js @@ -17,7 +17,7 @@ class UpdootCommand extends Command { async exec(message) { const upDoot = new MessageEmbed() - .setColor('#0099ff') + .setColor(message.member.displayHexColor) .setTitle('Vote for my bot') .setAuthor(message.author.username) .setDescription('You can vote for my bot if you think the bot is awesome!') diff --git a/event/listeners/message.js b/event/listeners/message.js index f39737d5..a90c8137 100644 --- a/event/listeners/message.js +++ b/event/listeners/message.js @@ -34,7 +34,7 @@ class messageListener extends Listener { censoredMessage = censoredMessage.replace(regex, '█'.repeat(bannedWords[i].get('word').length)); } let Embed = new MessageEmbed() - .setColor('#FF0000') + .setColor(message.member.displayHexColor) .setAuthor(message.author.username, message.author.displayAvatarURL()) .setDescription(censoredMessage);