Added user configurable mentions
parent
e51b82e3f8
commit
92508c7e3f
|
@ -21,6 +21,7 @@ const defaultConfig = {
|
||||||
"responseMessage": "Thank you for your message! Our mod team will reply to you here as soon as possible.",
|
"responseMessage": "Thank you for your message! Our mod team will reply to you here as soon as possible.",
|
||||||
|
|
||||||
"newThreadCategoryId": null,
|
"newThreadCategoryId": null,
|
||||||
|
"mentionRoleID": null,
|
||||||
|
|
||||||
"inboxServerPermission": null,
|
"inboxServerPermission": null,
|
||||||
"alwaysReply": false,
|
"alwaysReply": false,
|
||||||
|
|
|
@ -79,9 +79,12 @@ async function createNewThreadForUser(user) {
|
||||||
|
|
||||||
const newThread = await findById(newThreadId);
|
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
|
// Ping moderators of the new thread
|
||||||
await newThread.postNonLogMessage({
|
await newThread.postNonLogMessage({
|
||||||
content: `@here New modmail thread (${newThread.user_name})`,
|
content: `${mention} New modmail thread (${newThread.user_name})`,
|
||||||
disableEveryone: false
|
disableEveryone: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -140,8 +140,11 @@ bot.on('messageCreate', async msg => {
|
||||||
// If the person who mentioned the bot is blocked, ignore them
|
// If the person who mentioned the bot is blocked, ignore them
|
||||||
if (await blocked.isBlocked(msg.author.id)) return;
|
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, {
|
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,
|
disableEveryone: false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue