UnionConverter

class UnionConverter(converters: Collection<GenericConverter>, typeName: Key? = null, shouldThrow: Boolean = false, var validator: <Error class: unknown class><Any> = null) : CoalescingConverter<Any>

Experimental converter allowing for combining other converters together, with the caveat of type erasure.

This converter does not support optional or defaulting converters.

Constructors

Link copied to clipboard
constructor(converters: Collection<GenericConverter>, typeName: Key? = null, shouldThrow: Boolean = false, validator: <Error class: unknown class><Any> = null)

Properties

Link copied to clipboard
open lateinit var argumentObj: Argument<*>
Link copied to clipboard
open val bot: ExtensibleBot
Link copied to clipboard
Link copied to clipboard
open val errorType: Key?
Link copied to clipboard
val kord: Kord
Link copied to clipboard
open lateinit override var parsed: Any
Link copied to clipboard
Link copied to clipboard
open override val required: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val signatureType: Key
Link copied to clipboard
open override var validator: <Error class: unknown class><Any>

Functions

Link copied to clipboard
open suspend fun getErrorKey(): Key
Link copied to clipboard
open suspend fun getErrorString(context: CommandContext): String
Link copied to clipboard
open override fun getKoin(): Koin
Link copied to clipboard
operator fun getValue(thisRef: Arguments, property: KProperty<*>): Any
Link copied to clipboard
open suspend fun handleError(t: Throwable, context: CommandContext): Key
Link copied to clipboard
open suspend fun mutate(context: CommandContext): Any
Link copied to clipboard
open suspend override fun parse(parser: StringParser?, context: CommandContext, named: List<String>?): Int
Link copied to clipboard
open suspend override fun parseOption(context: CommandContext, option: OptionValue<*>): Boolean
Link copied to clipboard
open fun toDefaulting(defaultValue: Any, outputError: Boolean, signatureType: Key?, showTypeInSignature: Boolean?, errorType: Key?, nestedValidator: Validator<Any>): DefaultingCoalescingConverter<Any>
Link copied to clipboard
open fun toOptional(signatureType: Key?, showTypeInSignature: Boolean?, errorType: Key?, outputError: Boolean, nestedValidator: Validator<Any?>): OptionalCoalescingConverter<Any>
Link copied to clipboard
open suspend override fun toSlashOption(arg: Argument<*>): OptionWrapper<StringChoiceBuilder>
Link copied to clipboard
open suspend fun validate(context: CommandContext)
Link copied to clipboard