Class SlashCommandPattern
java.lang.Object
com.symphony.bdk.core.activity.parsing.SlashCommandPattern
Class representing the pattern of a
SlashCommand
.
The string should be a list of tokens separated by whitespaces. Each token can be:
- a regular static word like "/command". This will only match the same string
- a string argument like "{argument}". This will match a single word (with no whitespaces)
- a mention argument like "{@mention}. This will match a mention
- a cashtag argument like "{$cashtag}" which will match a cashtag
- a hashtag argument like "{#cashtag}" which will match a hashtag
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetMatchResult
(V4Message message) void
prependToken
(CommandToken token) Adds a specific token at the beginning of the slash command pattern
-
Constructor Details
-
SlashCommandPattern
- Parameters:
pattern
- the slash command pattern
-
-
Method Details
-
getTokens
- Returns:
- the list of command tokens
-
prependToken
Adds a specific token at the beginning of the slash command pattern- Parameters:
token
- the command token to add
-
getArgumentDefinitions
- Returns:
- the map of key-value pairs (argument name, argument type)
-
getMatchResult
- Parameters:
message
- the input message to be matched against theSlashCommandPattern
- Returns:
- the
MatchResult
object containing the status (matches or not) and the potential arguments.
-