Annotation Interface Subcommand


@ReleasedSince("26.8.301") @Target(TYPE) @Retention(RUNTIME) public @interface Subcommand
Declares a nested static inner class as a runnable Discord Subcommand.

Can be placed directly inside a Command class or nested inside a SubcommandGroup class. The class must define an execution method annotated with Execute.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    A concise description explaining the action performed by this subcommand.
    The name of the subcommand.
  • Element Details

    • name

      String name
      The name of the subcommand. Must be lowercase and match Discord's naming requirements.
      Returns:
      the subcommand name
    • description

      String description
      A concise description explaining the action performed by this subcommand.
      Returns:
      the subcommand description