SingleToDefaultingConverter
A special SingleConverter that wraps another SingleConverter, effectively turning it into an optional converter with the same logic, but with a default value if parsing fails.
Parameters
The SingleConverter to wrap.
An optional signature type string to override the one set in singleConverter.
An optional boolean to override the showTypeInSignature setting set in singleConverter.
An optional error type string to override the one set in singleConverter.
Properties
Argument object containing this converter and its metadata.
Current instance of the bot.
Access to the converter builder, perhaps a bit more hacky than it should be but whatever.
If the signatureType isn't sufficient, you can optionally provide a translation key pointing to a longer type string to use for error messages.
Whether the argument parser should output parsing errors on invalid arguments.
This will be set to true by the argument parser if the conversion succeeded.
For commands with generated signatures, set whether the type string should be shown in the signature.
Translation key pointing to a short string describing the type of data this converter handles. Should be very short.
Functions
Return a Key representing a pre-translated error string.
Return a translated, formatted error string.
Given a Throwable encountered during the parse function, return a human-readable string to display on Discord.
Call the mutator lambda, if one was provided.
Process the string in the given parser, converting it into a new value.
Use the given option taken straight from the slash command invocation to fill the converter.
Call the validator lambda, if one was provided.