Moderation workflow guide
How to make a Discord moderation bot
Build one staff command at a time, check the invoking member's permission before the action, and make every allowed and denied path explicit.
Choose a narrow moderation job
Start with one moderation action such as kicking a member, banning a member, or clearing a limited number of recent messages. A narrow workflow is easier to permission, test, explain, and audit than a single command with many hidden branches.
Build the workflow
- Add a slash commandDefine the target input and reason required for the selected moderation action.
- Check staff permissionRoute unauthorized invocations to a response that does not reach the moderation node.
- Run one actionConnect Kick member, Ban member, or Clear messages only on the allowed branch.
- Post the resultConfirm success or failure in an appropriate channel without exposing sensitive report content.
- Test permission and hierarchy failuresTest authorized, unauthorized, and unmanageable targets before publishing.
Respect Discord's permission model
The workflow should require the least staff permission appropriate for the action. Discord role hierarchy still controls whether the bot can manage the target member, and the bot should never be granted Administrator merely to avoid configuring required permissions.
Review the moderation blueprint
Review the moderation bot template, permission check, and kick or ban action.