Annotation Interface TextCommand


@Retention(RUNTIME) @Target(TYPE) public @interface TextCommand
Marks a class as an annotation-driven legacy text command.

Classes annotated with @TextCommand should extend ModernBaseTextCommand to be properly registered and routed by the TextCommandRegistrar.

Note: Due to Discord's strict restrictions on the Message Content Intent, the use of legacy text commands is generally discouraged in favor of Slash Commands.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    @NotNull String
    The primary name used to trigger this command.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    @NotNull String[]
    An optional array of alternative names that can also be used to trigger this command.
  • Element Details

    • commandName

      @NotNull @NotNull String commandName
      The primary name used to trigger this command.

      This string should not include the command prefix. For example, if your bot prefix is "!" and you want the command to be "!ping", you should set this value to simply "ping".

      Returns:
      The main command name.
    • aliases

      @NotNull @NotNull String[] aliases
      An optional array of alternative names that can also be used to trigger this command.

      For example, if the primary command name is "serverinfo", you might provide aliases like {"si", "info"}.

      Returns:
      An array of command aliases, or an empty array if no aliases are defined.
      Default:
      {}