When a member of your server tries to mention "@here" or "@everyone", installing this snippet will make your bot remove chat permissions for an hour for that person using Discord's timeout feature. This will not affect the server owner or other members with admin permissions, since timeouts cannot be set on those users. Admins can remove timeouts by right clicking the member's icon and selecting the option that appears.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const SECONDS_IN_AN_HOUR = 3600;
if (
context.params.event.content.includes('@here') ||
context.params.event.content.includes('@everyone')
) {
await lib.discord.guilds['@0.2.1'].members.timeout.update({
user_id: `${context.params.event.author.id}`,
guild_id: `${context.params.event.guild_id}`,
communication_disabled_until_seconds: SECONDS_IN_AN_HOUR,
reason: `Attempting to mention everyone in the server`
});
}