Display source guild in bot mention notifications

Only when using multiple main guilds.
master
Dragory 2018-04-21 15:54:41 +03:00
parent 46c2cf0eeb
commit 3911d92edc
1 changed files with 10 additions and 1 deletions

View File

@ -151,8 +151,17 @@ bot.on('messageCreate', async msg => {
// If the person who mentioned the bot is blocked, ignore them
if (await blocked.isBlocked(msg.author.id)) return;
let content;
const mainGuilds = utils.getMainGuilds();
if (mainGuilds.length === 1) {
content = `${utils.getInboxMention()}Bot mentioned in ${msg.channel.mention} by **${msg.author.username}#${msg.author.discriminator}**: "${msg.cleanContent}"`;
} else {
content = `${utils.getInboxMention()}Bot mentioned in ${msg.channel.mention} (${msg.channel.guild.name}) by **${msg.author.username}#${msg.author.discriminator}**: "${msg.cleanContent}"`;
}
bot.createMessage(utils.getLogChannel(bot).id, {
content: `${utils.getInboxMention()}Bot mentioned in ${msg.channel.mention} by **${msg.author.username}#${msg.author.discriminator}**: "${msg.cleanContent}"`,
content,
disableEveryone: false,
});
});