/warn @member reason. The bot counts each member’s warnings, DMs them, and gives a timeout at 3 warnings.
Step 1: The variable
Makewarnings: type User, storing a Number, scope Server Specific, starts as 0.
Step 2: /warn
- Make a slash command called
warn. - Add Inputs: a User input
member(required) and a Text inputreason(required). - Add a permissions check (search
permission): Moderate Members. - On the yes path:
- Do the maths on
warnings, whose variable: the member from the input,+ 1. - A block that sends a direct message to that member, with the reason (pick the reason input with Variables).
- Reply:
Warning given. - Compare: is that member’s
warnings3 or more? - On that yes path: the timeout block (search
timeout) for 1 hour, then Save a valuewarningsback to0for that member.
- Do the maths on
- On the else path of the permissions check: Reply:
Only moderators can warn people.
When a block fails
Some blocks can fail. For example, the bot cannot time out someone with a higher role, and a DM fails if the member has DMs closed. Many blocks have two extra paths:- the green path: “it worked”
- the red path: “it failed”
I couldn't do that. Is my role high enough?
You can also choose what happens for the whole command in If something breaks on the first block: Explain the problem, My own message, Stay silent, Alert a staff channel, or Skip the broken block and continue.
More moderation blocks
Search the block list for these words:kick, ban, timeout, nickname, delete (messages), bulk (many messages at once).