A Discord moderation bot, built from blocks
Moderation is mostly a few slash commands that take a member and a reason, plus rules that act on their own. Bot Creator has one block per action, and a block that creates Discord AutoMod rules.
How to build it
- Create a Slash command with a user option and a reason option. The values are read as
((opts.user.id))and((opts.reason))(use the option names you chose). - Add the action block: Ban User (with the number of days of messages to delete), Kick User, Mute User (a timeout, with a duration such as
10mor1h), Unmute User or Unban User. - Add Respond with Message to confirm, and tick the private reply option so only the moderator sees it.
- For clean-up, use Delete Messages (a count, optionally only one user’s messages, or only bots or only users) and Slowmode (a duration,
0to disable). - For rules that act on their own, use Create AutoMod Rule: trigger on keywords, spam, keyword presets or mention spam, and block the message, send an alert to a channel or time the member out.
Blocks you will use
Block names are the ones of the app; each links to its entry in the dictionary.
- Ban User — Bans a user, with a reason and the number of days of messages to delete.
- Kick User — Kicks a member.
- Mute User — Times a member out for a duration or until a date.
- Unmute User — Removes a timeout.
- Unban User — Lifts a ban.
- Delete Messages — Deletes a number of messages, with filters.
- Slowmode — Sets or removes a channel's slowmode.
- Create AutoMod Rule — Creates a Discord AutoMod rule.
What to know
- The bot needs the matching permission on your server, and its role must sit above the role of the member it acts on (Discord rule).
- There is no ready-made warning or case-log block. You build a warning count with per-member variables; the BDFD warn-system guide shows the idea.
- To limit who can use a slash command, use Discord’s own command permissions (Server Settings, Integrations).