diff --git a/src/config.js b/src/config.js index 89abb30..c2c79f2 100644 --- a/src/config.js +++ b/src/config.js @@ -21,6 +21,7 @@ const defaultConfig = { "responseMessage": "Thank you for your message! Our mod team will reply to you here as soon as possible.", "newThreadCategoryId": null, + "mentionRoleID": null, "inboxServerPermission": null, "alwaysReply": false, diff --git a/src/data/threads.js b/src/data/threads.js index 21ca3aa..85b0ce6 100644 --- a/src/data/threads.js +++ b/src/data/threads.js @@ -79,9 +79,12 @@ async function createNewThreadForUser(user) { const newThread = await findById(newThreadId); + //If no role is set, mention @here + const mention = (config.mentionRoleID == null) ? "@here" : `<@&${config.mentionRoleID}>`; + // Ping moderators of the new thread await newThread.postNonLogMessage({ - content: `@here New modmail thread (${newThread.user_name})`, + content: `${mention} New modmail thread (${newThread.user_name})`, disableEveryone: false }); diff --git a/src/main.js b/src/main.js index ef61382..4845486 100644 --- a/src/main.js +++ b/src/main.js @@ -140,8 +140,11 @@ bot.on('messageCreate', async msg => { // If the person who mentioned the bot is blocked, ignore them if (await blocked.isBlocked(msg.author.id)) return; + //If no role is set, mention @here + const mention = (config.mentionRoleID == null) ? "@here" : `<@&${config.mentionRoleID}>`; + bot.createMessage(utils.getLogChannel(bot).id, { - content: `@here Bot mentioned in ${msg.channel.mention} by **${msg.author.username}#${msg.author.discriminator}**: "${msg.cleanContent}"`, + content: `${mention} Bot mentioned in ${msg.channel.mention} by **${msg.author.username}#${msg.author.discriminator}**: "${msg.cleanContent}"`, disableEveryone: false, }); });