Merge branch 'master' of https://github.com/HaydenMeloche/modmailbot into pull59-master

master
Dragory 2018-03-11 21:42:17 +02:00
commit 4089e836d4
3 changed files with 9 additions and 2 deletions

View File

@ -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,

View File

@ -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
});

View File

@ -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,
});
});