From 7bec58cd1c4ea86de7ed1a68b495d007ecfc4aa2 Mon Sep 17 00:00:00 2001 From: Robert Klebes Date: Sun, 19 Jan 2020 14:31:29 -0500 Subject: [PATCH] Add direct link to message onBotMention (#319) --- .gitignore | 1 + src/data/constants.js | 3 ++- src/main.js | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6757ecf..2ccc665 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ !/config.example.ini /welcome.png /update.sh +/tags.* diff --git a/src/data/constants.js b/src/data/constants.js index 13a30e8..b7982c7 100644 --- a/src/data/constants.js +++ b/src/data/constants.js @@ -50,6 +50,7 @@ module.exports = { 'okey thx', 'okey no problem', 'okey np', - 'cheers' + 'cheers', + '!close' ], }; diff --git a/src/main.js b/src/main.js index 5a29e70..0a6446c 100644 --- a/src/main.js +++ b/src/main.js @@ -124,6 +124,7 @@ function initBaseMessageHandlers() { messageQueue.add(async () => { let thread = await threads.findOpenThreadByUserId(msg.author.id); + // New thread if (! thread) { // Ignore messages that shouldn't usually open new threads, such as "ok", "thanks", etc. @@ -211,11 +212,12 @@ function initBaseMessageHandlers() { const staffMention = (config.pingOnBotMention ? utils.getInboxMention() : ''); if (mainGuilds.length === 1) { - content = `${staffMention}Bot mentioned in ${msg.channel.mention} by **${msg.author.username}#${msg.author.discriminator}**: "${msg.cleanContent}"`; + content = `${staffMention}Bot mentioned in ${msg.channel.mention} by **${msg.author.username}#${msg.author.discriminator}(${msg.author.id})**: "${msg.cleanContent}"\n\n`; } else { - content = `${staffMention}Bot mentioned in ${msg.channel.mention} (${msg.channel.guild.name}) by **${msg.author.username}#${msg.author.discriminator}**: "${msg.cleanContent}"`; + 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`; } + bot.createMessage(utils.getLogChannel().id, { content, disableEveryone: false,