AutoMod

Premium
Back to Tutorials

Building Your First Custom Command

Two worked examples: a plain info command, and one with options that grants a role, sends a DM, and confirms it.

1

What Custom Commands do

Custom Commands become real Discord slash commands, created, updated, and removed through Discord's API, with their own arguments people fill in when they type /yourcommand. A command runs one or more actions in order, top to bottom, when someone uses it.

See the full reference
2

Example: a simple info command

The simplest command is a fixed reply with no options and one action. Good for FAQs, rules, or anything you keep typing out by hand:

FieldValue
Namerules
DescriptionShow the server rules
OptionsNone
ActionReply: "📋 Check out #rules for our full server guidelines!"
3

Example: options that grant a role and send a DM

Options get more useful once an action uses them for more than text. This command takes two required options, who to grant access to and a personal note, then runs three actions: it adds a fixed role to the selected member, DMs them with the note included, and replies to confirm.

Options

OptionTypeDescription
{member}UserRequired. The member to grant access to
{message}TextRequired. A personal note to include in their DM

Actions

ActionConfiguration
1. Add RoleTarget: member (Custom Option) · Role: Member (fixed)
2. Send DMTarget: member (Custom Option) · Message: "Welcome! {message}"
3. Reply"✅ Done, {member.mention} now has access." · Ephemeral: on
4

Publishing and testing it

Saving a command registers it with Discord automatically. There's no separate publish step. It can take a minute or two to appear when you type /, and if the command list ever looks outdated, the Sync Now button in Custom Commands re-registers everything at once.

You've got the basics

From here, try the Random Reply action for variety, or explore Groups to keep a growing set of commands organized.