From e8de270df144fc1ad200ae969493795727bdcc88 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 9 Apr 2020 16:27:12 +0200 Subject: [PATCH] Show if its a bot or not Don't delete the original message Handle spaces after the message link --- event/listeners/message.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/event/listeners/message.js b/event/listeners/message.js index aaf21795..6bca0d92 100644 --- a/event/listeners/message.js +++ b/event/listeners/message.js @@ -252,7 +252,7 @@ class messageListener extends Listener { let url = message.content.split('/'); let guildID = url[4]; let channelID = url[5]; - let messageID = url[6]; + let messageID = url[6].split(' ')[0]; // Verify if the guild, channel and message exist @@ -268,22 +268,22 @@ class messageListener extends Listener { let Embed = this.client.util.embed() .setAuthor(quote.author.username, quote.author.displayAvatarURL()) + .setColor(message.member ? message.member.displayHexColor : 'NAVY') .addField('Jump to', `[message](https://discordapp.com/channels/${message.guild.id}/${channelID}/${messageID})`, true) .addField('In channel', quote.channel.name, true) .addField('Quoted by', message.author, true) .setDescription(quote.content) .setTimestamp(quote.createdTimestamp); - if (quote.member) Embed.setColor(quote.member.displayHexColor); + if (quote.member) Embed.setAuthor(`${quote.author.username}#${quote.author.discriminator}`, quote.author.displayAvatarURL()); + + if (quote.author.bot) Embed.setAuthor(`${quote.author.username}#${quote.author.discriminator} (bot)`, quote.author.displayAvatarURL()); if (guild.id != message.guild.id) Embed.addField('In guild', guild.name, true); let Attachment = (quote.attachments).array(); if (Attachment[0]) Embed.setImage(Attachment[0].url); - return message.channel.send(Embed) - .then(() => { - message.delete(); - }); + return message.channel.send(Embed); } } }