From b992b49c5c55cfcfe7630c6fe9ad526c22d62f1d Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Fri, 21 Aug 2020 05:16:23 +0300 Subject: [PATCH] Clean up bot mention notification styles --- src/main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index 600b3c6..b1316a9 100644 --- a/src/main.js +++ b/src/main.js @@ -245,10 +245,13 @@ function initBaseMessageHandlers() { const staffMention = (config.pingOnBotMention ? utils.getInboxMention() : ""); const allowedMentions = (config.pingOnBotMention ? utils.getInboxMentionAllowedMentions() : undefined); + const userMentionStr = `**${msg.author.username}#${msg.author.discriminator}** (\`${msg.author.id}\`)`; + const messageLink = `https:\/\/discordapp.com\/channels\/${msg.channel.guild.id}\/${msg.channel.id}\/${msg.id}`; + if (mainGuilds.length === 1) { - content = `${staffMention}Bot mentioned in ${msg.channel.mention} by **${msg.author.username}#${msg.author.discriminator}(${msg.author.id})**: "${msg.cleanContent}"\n\n`; + content = `${staffMention}Bot mentioned in ${msg.channel.mention} by ${userMentionStr}: "${msg.cleanContent}"\n\n<${messageLink}>`; } else { - content = `${staffMention}Bot mentioned in ${msg.channel.mention} (${msg.channel.guild.name}) by **${msg.author.username}#${msg.author.discriminator}(${msg.author.id})**: "${msg.cleanContent}"\n\n`; + content = `${staffMention}Bot mentioned in ${msg.channel.mention} (${msg.channel.guild.name}) by ${userMentionStr}: "${msg.cleanContent}"\n\n<${messageLink}>`; } bot.createMessage(utils.getLogChannel().id, {