arg
Extension function for CommandContext that retrieves and parses the argument at the specified index.
The argument is parsed according to the provided type. If the argument is missing or cannot be parsed, an error message is thrown.
Return
The parsed argument of type T.
Parameters
index
The index of the argument to retrieve.
type
The type of the argument to parse.
Throws
If the argument is missing or cannot be parsed.
Inline extension function for CommandContext that retrieves and parses the argument at the specified index.
This function infers the type T from the reified type argument.
Return
The parsed argument of type T.
Parameters
index
The index of the argument to retrieve.
Throws
If the argument is missing or cannot be parsed.