JDATextCommandVariation
Declares this function as a text command, additional properties can be set with @TextCommandData.
Additional annotations
Additional data can be set by using @TextCommandData once per top-level name, by specifying their target path.
Text command variations
A given text command path (such as ban temp) is composed of at least one variation; Each variation has different parameters, and will display separately in the built-in help content.
Each variation runs based off its priority, the first variation that has a full match against the user input gets executed.
If no regex-based variation (using a BaseCommandEvent) matches, the fallback variation is executed (if a variation using CommandEvent exists).
If no variation matches and there is no fallback, then the help content is invoked for the command.
Note on command complexity
You might have errors if your command is considered too complex. Several factors can increase the chance of a command being unusable, such as
Too many optionals
Options with a dynamic number of spaces (such as strings)
Attempts at fixing the issue can include moving the parameters around, like avoiding 2 strings next to each other.
Requirements
The declaring class must be annotated with @Command
First parameter must be BaseCommandEvent, or, CommandEvent for fallback commands/manual token consumption.
Option types
Input options: Uses @TextOption.
Generated options: Use @GeneratedOption, implement TextGeneratedValueSupplierProvider and return, on the correct command path/option name, an appropriate supplier that will generate an object of the correct type.
Custom options: No annotation, additional types can be added by implementing ICustomResolver.
Service options: No annotation, however, I recommend injecting the service in the class instead.
Permissions
Required user/bot permissions can be set with @UserPermissions/@BotPermissions.
Execution filtering
You can arbitrarily prevent execution of commands by using @Filter, passing an implementation of TextCommandFilter.
Rate limiting
See @RateLimit / @Cooldown. The annotations apply to the command itself, not only this variation, in other words, this applies to all commands with the same path.
See also
@Category
@Hidden
@NSFW
Declaring text commands using the DSL
DSL equivalent