If a certain role is mentioned in chat send a message into that chat! For example: if used for @looking-to-play when the role is mentioned it can tell other users if they wish to not be mentioned by that role to head to #selfroles to remove it..
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let hasMentionedRole = context.params.event.mention_roles.find(
(mentionedRoleId) => {
return mentionedRoleId === `${process.env.mentionedRoleId}`;
}
);
if (hasMentionedRole) {
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `If you wish to not be mentioned by <@&${process.env.mentionedRoleId}> go to your reaction roles channel to remove it.`,
allowed_mentions: {
parse: []
}
});
}
//.MeltedButter#9266