Interface SnowflakeParser<T extends @NonNull Object>

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>

public non-sealed interface SnowflakeParser<T extends @NonNull Object> extends InputParser<Snowflake,T>
Parses snowflake-based input arguments.

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
  • 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.