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 58fd71c..25f551c 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 5c665b5..3701247 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, }); });