Skip to main content
Commands extend Command and use decorators to describe the application command Discord should register.

Create a Chat Input Command

Place the class in the command directory passed to client.load(). The loader discovers the class and adds its builder to the application-command registry.

Add Subcommands

Use @RegisterSubcommand on methods that should receive a specific subcommand:
Subcommand groups, user context-menu commands, message context-menu commands, and guild restrictions use the matching registration decorators exposed by the package.

Publish Command Definitions

After loading pieces, push the registry to Discord:
Global command changes can take time to propagate. Use guild-restricted commands while iterating when you need changes to appear immediately.

Test Before Publishing

The testing package can run the same command class against a local interaction fixture without contacting Discord. See Testing interactions for a complete example.