1
0
Fork 0

Make embed use rank color

akairo
loicbersier 5 years ago
parent e73e9a3a2a
commit 630248d9ea

@ -62,7 +62,7 @@ class FourchanCommand extends Command {
} }
const FourchanEmbed = new MessageEmbed() const FourchanEmbed = new MessageEmbed()
.setColor('#ff9900') .setColor(message.member.displayHexColor)
.setTitle(title) .setTitle(title)
.setDescription(htmlToText.fromString(description)) .setDescription(htmlToText.fromString(description))
.setImage(`https://i.4cdn.org/${args.board}/${response.threads[i].posts[0].tim}${response.threads[i].posts[0].ext}`) .setImage(`https://i.4cdn.org/${args.board}/${response.threads[i].posts[0].tim}${response.threads[i].posts[0].ext}`)

@ -43,7 +43,7 @@ class RedditCommand extends Command {
if (response.data.children[i].data.over_18 == true && !message.channel.nsfw) if (response.data.children[i].data.over_18 == true && !message.channel.nsfw)
return message.channel.send('No nsfw'); return message.channel.send('No nsfw');
const redditEmbed = new MessageEmbed() const redditEmbed = new MessageEmbed()
.setColor('#ff9900') .setColor(message.member.displayHexColor)
.setTitle(response.data.children[i].data.title) .setTitle(response.data.children[i].data.title)
.setDescription(response.data.children[i].data.selftext) .setDescription(response.data.children[i].data.selftext)
.setURL('https://reddit.com' + response.data.children[i].data.permalink) .setURL('https://reddit.com' + response.data.children[i].data.permalink)

@ -20,7 +20,7 @@ class AdviceCommand extends Command {
return response.json(); return response.json();
}).then((response) => { }).then((response) => {
const adviceEmbed = new MessageEmbed() const adviceEmbed = new MessageEmbed()
.setColor('#ff9900') .setColor(message.member.displayHexColor)
.setTitle(response.slip.slip_id) .setTitle(response.slip.slip_id)
.setDescription(response.slip.advice); .setDescription(response.slip.advice);

@ -36,7 +36,7 @@ class guessCommand extends Command {
const leaderboard = await guessLeaderboard.findAll({order: ['try']}); const leaderboard = await guessLeaderboard.findAll({order: ['try']});
let top = []; let top = [];
let leaderboardEmbed = new MessageEmbed() let leaderboardEmbed = new MessageEmbed()
.setColor('#0099ff') .setColor(message.member.displayHexColor)
.setTitle('Guess leaderboard'); .setTitle('Guess leaderboard');
for (let i = 0; i < leaderboard.length; i++) { for (let i = 0; i < leaderboard.length; i++) {
this.client.users.fetch(leaderboard[i].get('memberID')) this.client.users.fetch(leaderboard[i].get('memberID'))

@ -31,7 +31,7 @@ class aboutCommand extends Command {
const aboutEmbed = new MessageEmbed() const aboutEmbed = new MessageEmbed()
.setColor('#ff9900') .setColor(message.member.displayHexColor)
.setAuthor(this.client.user.username, this.client.user.avatarURL()) .setAuthor(this.client.user.username, this.client.user.avatarURL())
.setTitle('About me') .setTitle('About me')
.setURL('https://gitlab.com/LoicBersier/DiscordBot') .setURL('https://gitlab.com/LoicBersier/DiscordBot')

@ -16,7 +16,7 @@ class donateCommand extends Command {
async exec(message) { async exec(message) {
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#ff9900') .setColor(message.member.displayHexColor)
.setTitle('Donation link') .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)'); .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)');

@ -38,7 +38,7 @@ class HelpCommand extends Command {
}, command.description); }, command.description);
const embed = this.client.util.embed() const embed = this.client.util.embed()
.setColor(0xFFAC33) .setColor(message.member.displayHexColor)
.setTitle(`\`${prefix[0]}${command.aliases[0]} ${description.usage}\``) .setTitle(`\`${prefix[0]}${command.aliases[0]} ${description.usage}\``)
.addField('Description', description.content) .addField('Description', description.content)
.setFooter(`All the available prefix: ${prefix.join(' | ')}`); .setFooter(`All the available prefix: ${prefix.join(' | ')}`);
@ -59,7 +59,7 @@ class HelpCommand extends Command {
async execCommandList(message) { async execCommandList(message) {
const embed = this.client.util.embed() const embed = this.client.util.embed()
.setColor(0xFFAC33) .setColor(message.member.displayHexColor)
.addField('Command List', .addField('Command List',
[ [
'This is a list of commands.', 'This is a list of commands.',

@ -68,7 +68,7 @@ class musicCommand extends Command {
let seconds = time - minutes * 60; let seconds = time - minutes * 60;
const musicEmbed = new MessageEmbed() const musicEmbed = new MessageEmbed()
.setColor('#ff9900') .setColor(message.member.displayHexColor)
.setTitle('Music found!') .setTitle('Music found!')
.addField('Title', response.results[0].recordings[0].title, true) .addField('Title', response.results[0].recordings[0].title, true)
.addField('Artist', response.results[0].recordings[0].artists[0].name, true) .addField('Artist', response.results[0].recordings[0].artists[0].name, true)

@ -31,7 +31,7 @@ class seebannedwordCommand extends Command {
if (list == undefined) return message.channel.send('No word are banned yet.'); if (list == undefined) return message.channel.send('No word are banned yet.');
const Embed = new MessageEmbed() const Embed = new MessageEmbed()
.setColor('#ff9900') .setColor(message.member.displayHexColor)
.setTitle('List of banned words') .setTitle('List of banned words')
.setDescription(list); .setDescription(list);

@ -37,7 +37,7 @@ class seetagCommand extends Command {
this.client.users.fetch(tagList.dataValues.ownerID) this.client.users.fetch(tagList.dataValues.ownerID)
.then(user => { .then(user => {
const TagEmbed = new MessageEmbed() const TagEmbed = new MessageEmbed()
.setColor('#ff9900') .setColor(message.member.displayHexColor)
.setTitle(message.guild.name) .setTitle(message.guild.name)
.addField('Trigger:', tagList['dataValues']['trigger']) .addField('Trigger:', tagList['dataValues']['trigger'])
.addField('Response:', tagList['dataValues']['response']) .addField('Response:', tagList['dataValues']['response'])
@ -47,7 +47,7 @@ class seetagCommand extends Command {
}) })
.catch(() => { .catch(() => {
const TagEmbed = new MessageEmbed() const TagEmbed = new MessageEmbed()
.setColor('#ff9900') .setColor(message.member.displayHexColor)
.setTitle(message.guild.name) .setTitle(message.guild.name)
.addField('Trigger:', tagList['dataValues']['trigger']) .addField('Trigger:', tagList['dataValues']['trigger'])
.addField('Response:', tagList['dataValues']['response']) .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}}); let tagList = await Tag.findAll({attributes: ['trigger'], where: {serverID: message.guild.id}});
const tagString = tagList.map(t => t.trigger).join(', ') || 'No tags set.'; const tagString = tagList.map(t => t.trigger).join(', ') || 'No tags set.';
const TagEmbed = new MessageEmbed() const TagEmbed = new MessageEmbed()
.setColor('#ff9900') .setColor(message.member.displayHexColor)
.setTitle('List of tags') .setTitle('List of tags')
.setDescription(tagString) .setDescription(tagString)
.setFooter('Use this command with the name of the tag to see more info about it!'); .setFooter('Use this command with the name of the tag to see more info about it!');

@ -17,7 +17,7 @@ class ServerCommand extends Command {
async exec(message) { async exec(message) {
const addEmbed = new MessageEmbed() const addEmbed = new MessageEmbed()
.setColor('#0099ff') .setColor(message.member.displayHexColor)
.setTitle(message.guild.name) .setTitle(message.guild.name)
.setThumbnail(message.guild.iconURL()) .setThumbnail(message.guild.iconURL())
.addField('Number of users', message.guild.members.filter(member => !member.user.bot).size, true) .addField('Number of users', message.guild.members.filter(member => !member.user.bot).size, true)

@ -51,7 +51,7 @@ class StatsCommand extends Command {
} }
const statsEmbed = new MessageEmbed() const statsEmbed = new MessageEmbed()
.setColor('#0099ff') .setColor(message.member.displayHexColor)
.setTitle('Bot stats') .setTitle('Bot stats')
.setAuthor('Haha yes') .setAuthor('Haha yes')
.addField('Servers', this.client.guilds.size, true) .addField('Servers', this.client.guilds.size, true)

@ -48,7 +48,7 @@ class TranslationCommand extends Command {
const translationEmbed = new MessageEmbed() const translationEmbed = new MessageEmbed()
.setColor('#0099ff') .setColor(message.member.displayHexColor)
.setTitle('Asked for the following translation:') .setTitle('Asked for the following translation:')
.setAuthor(message.author.username) .setAuthor(message.author.username)
.setDescription(response.text[0]) .setDescription(response.text[0])

@ -17,7 +17,7 @@ class UpdootCommand extends Command {
async exec(message) { async exec(message) {
const upDoot = new MessageEmbed() const upDoot = new MessageEmbed()
.setColor('#0099ff') .setColor(message.member.displayHexColor)
.setTitle('Vote for my bot') .setTitle('Vote for my bot')
.setAuthor(message.author.username) .setAuthor(message.author.username)
.setDescription('You can vote for my bot if you think the bot is awesome!') .setDescription('You can vote for my bot if you think the bot is awesome!')

@ -34,7 +34,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 = new MessageEmbed() let Embed = new MessageEmbed()
.setColor('#FF0000') .setColor(message.member.displayHexColor)
.setAuthor(message.author.username, message.author.displayAvatarURL()) .setAuthor(message.author.username, message.author.displayAvatarURL())
.setDescription(censoredMessage); .setDescription(censoredMessage);

Loading…
Cancel
Save