parse

abstract suspend fun parse(parser: StringParser?, context: CommandContext, named: NamedInputType? = null): ResultType

Process the string in the given parser, converting it into a new value.

The resulting value should be stored in parsed - this will not be done for you.

If you'd like to return more detailed feedback to the user on invalid input, you can throw a DiscordRelayedException here.

Return

Whether you managed to convert the argument. If you don't want to provide extra context to the user, simply return false or 0 depending on your converter type - the command system will generate an error message for you.

Parameters

parser

StringParser used to parse the command, if any

context

MessageCommand context object, containing the event, message, and other command-related things

See also