- Type Parameters:
T- The type of argument that is provided.
- All Superinterfaces:
ArgumentParser<Snowflake,,T> BiFunction<CommandContext,,Snowflake, Mono<T>> InputParser<Snowflake,,T> ParserFunction<Snowflake,T>
Note that no validation is performed on the raw value received ahead of time.
The benefit offered over using a StringParser with a snowflake or
entity-id parser function is that, for hybrid commands (text and slash) that need
only a plain ID (instead of a proper entity object), this type can appear in the
slash command as a proper type (user/role/channel), which also saves on parsing
cost, while avoiding the need to fetch the entity separately in the text command,
losing only the validation.
Note that, when used in a message-based invocation, a parser with a type other than
SnowflakeParser.Type.ANY accepts the same formats as those supported by the corresponding
EntityRefParser.
- Since:
- 1.0
- Version:
- 1.0
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface dev.sympho.modular_commands.api.command.parameter.parse.ParserFunction
ParserFunction.PostParser<R extends @NonNull Object,I extends @NonNull Object, T extends @NonNull Object, P1 extends @NonNull ParserFunction<R, I>, P2 extends @NonNull ParserFunction<I, T>> -
Method Summary
Methods inherited from interface dev.sympho.modular_commands.api.command.parameter.parse.ArgumentParser
parse, parseArgument, validateRawMethods inherited from interface java.util.function.BiFunction
andThenMethods inherited from interface dev.sympho.modular_commands.api.command.parameter.parse.ParserFunction
apply, then
-
Method Details
-
type
The ID type accepted.As no validation is performed, this only affects how the parameter is registered in a slash command. It has no functional difference for the handler.
- Returns:
- The ID type.
-