This bot deletes any message that mentions set user and gives the user who sent the message a warning message
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let userId = process.env.USER_ID;
if (context.params.event.mentions[0]?.id === `${userId}`) {
await lib.discord.channels['@0.3.0'].messages.destroy({
message_id: `${context.params.event.id}`,
channel_id: `${context.params.event.channel_id}`,
});
return lib.discord.channels['@0.3.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `**HEY** <@${context.params.event.author.id}> stop right there!👮\nHave you not read the rules?\nNo pinging **USER**\nGo read the rules!`,
});
}