@API(status=INTERNAL)
public class SlashCommandPattern
extends java.lang.Object
SlashCommand
.
The string should be a list of tokens separated by whitespaces. Each token can be:
Constructor and Description |
---|
SlashCommandPattern(java.lang.String pattern) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,? extends java.lang.Class<?>> |
getArgumentDefinitions() |
MatchResult |
getMatchResult(V4Message message) |
java.util.List<CommandToken> |
getTokens() |
void |
prependToken(CommandToken token)
Adds a specific token at the beginning of the slash command pattern
|
public SlashCommandPattern(java.lang.String pattern)
pattern
- the slash command pattern{@link
- SlashCommandSyntaxException} if the pattern is not well formattedpublic java.util.List<CommandToken> getTokens()
public void prependToken(CommandToken token)
token
- the command token to addpublic java.util.Map<java.lang.String,? extends java.lang.Class<?>> getArgumentDefinitions()
public MatchResult getMatchResult(V4Message message)
message
- the input message to be matched against the SlashCommandPattern
MatchResult
object containing the status (matches or not) and the potential arguments.