JDAText Command Variation
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.
Requirements
The declaring class must be annotated with @Command and extend TextCommand
First parameter must be BaseCommandEvent, or, CommandEvent for fallback commands/manual token consumption.
Option types
Input options: Uses @TextOption, supported types and modifiers are in ParameterResolver, additional types can be added by implementing TextParameterResolver.
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.
See also
@Command
@TextCommandData
@Category
@TextOption
@Hidden
@NSFW
@BotPermissions
@UserPermissions
@Cooldown
@RateLimit
@Filter
Declaring text commands using the DSL
DSL equivalent