Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Creating Slash Commands

Kevin edited this page Oct 9, 2023 · 5 revisions

While creating slash commands is mostly similar to creating message commands, there are a few key differences.

For general information on how to structure commands, consult the ACF core wiki.

Key differences

  • Every part of a slash command requires to be annotated with @Description. This includes: the root command, subcommand groups, subcommands and any command parameters that can or will be resolved through user input. This is required by Discord.
  • Slash commands do not support the usage of the @CatchUnknown annotation. Each root command class, as well as any inner classes should at least have a single method annotated with @Default, or one or more methods annotated with @Subcommand.
  • While slash commands do support inner classes, they do not support nested inner classes. This is because Discord (currently) does not support nested subcommand groups.

Examples

For some examples on how to create slash commands, see these test classes.