Class MessageParser
java.lang.Object
dev.sympho.modular_commands.utils.parse.EntityParser<Message>
dev.sympho.modular_commands.utils.parse.MessageParser
- All Implemented Interfaces:
ParserFunction<String,,Message> BiFunction<CommandContext,String, Mono<Message>>
A parser that extracts a message from a string.
- Since:
- 1.0
- Version:
- 1.0
-
Nested Class Summary
Nested 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>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEntity(CommandContext context, Snowflake id) Retrieves the entity with the given ID.Retrieves the parser to use for URLs, if supported.Methods inherited from class dev.sympho.modular_commands.utils.parse.EntityParser
extractId, parse, parseIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThenMethods inherited from interface dev.sympho.modular_commands.api.command.parameter.parse.ParserFunction
apply, then
-
Constructor Details
-
MessageParser
public MessageParser()Creates a new instance.
-
-
Method Details
-
getUrlParser
Description copied from class:EntityParserRetrieves the parser to use for URLs, if supported.- Overrides:
getUrlParserin classEntityParser<Message>- Returns:
- The URL parser, or
nullif URLs are not supported.
-
getEntity
Description copied from class:EntityParserRetrieves the entity with the given ID.- Specified by:
getEntityin classEntityParser<Message>- Parameters:
context- The execution context.id- The entity ID.- Returns:
- The entity. May be empty if not found.
-