Package-level declarations

Types

Link copied to clipboard
typealias AutoCompleteCallback = suspend AutoCompleteInteraction.(event: AutoCompleteInteractionCreateEvent) -> Unit?

Type alias representing an autocomplete callable.

Link copied to clipboard
abstract class CoalescingConverter<T : Any>(val shouldThrow: Boolean = false, var validator: Validator<T> = null) : MultiNamedInputConverter<List<T>, T, Int> , SlashCommandConverter

Abstract base class for a coalescing converter.

Link copied to clipboard
class CoalescingToDefaultingConverter<T : Any>(val coalescingConverter: CoalescingConverter<T>, defaultValue: T, outputError: Boolean = false, newSignatureType: Key? = null, newShowTypeInSignature: Boolean? = null, newErrorType: Key? = null, var validator: Validator<T> = null) : DefaultingCoalescingConverter<T>

A special OptionalConverter that wraps a SingleConverter, effectively turning it into an optional converter with the same logic.

Link copied to clipboard
class CoalescingToOptionalConverter<T : Any>(val coalescingConverter: CoalescingConverter<T>, newSignatureType: Key? = null, newShowTypeInSignature: Boolean? = null, newErrorType: Key? = null, outputError: Boolean = false, var validator: Validator<T?> = null) : OptionalCoalescingConverter<T>

A special OptionalConverter that wraps a SingleConverter, effectively turning it into an optional converter with the same logic.

Link copied to clipboard

Base class for an argument converter.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class ConverterToDefaulting

Opt-in annotation for .toDefaulting() converter functions.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class ConverterToMulti

Opt-in annotation for .toMulti() converter functions.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class ConverterToOptional

Opt-in annotation for .toOptional() converter functions.

Link copied to clipboard
abstract class DefaultingCoalescingConverter<T : Any>(defaultValue: T, val outputError: Boolean = false, var validator: Validator<T> = null) : MultiNamedInputConverter<List<T>, T, Int> , SlashCommandConverter

Abstract base class for a defaulting coalescing converter.

Link copied to clipboard
abstract class DefaultingConverter<T : Any>(defaultValue: T, val outputError: Boolean = false, var validator: Validator<T> = null) : SingleNamedInputConverter<T, T, Boolean> , SlashCommandConverter

Abstract base class for a defaulting converter.

Link copied to clipboard
abstract class ListConverter<T : Any>(required: Boolean = true, var validator: Validator<List<T>> = null) : MultiNamedInputConverter<List<T>, List<T>, Int> , SlashCommandConverter

Abstract base class for a multi converter.

Link copied to clipboard
typealias Mutator<T> = suspend CommandContext.(value: T) -> T?

Type alias representing a mutator callable. Keeps things relatively maintainable.

Link copied to clipboard
abstract class OptionalCoalescingConverter<T : Any>(val outputError: Boolean = false, var validator: Validator<T?> = null) : MultiNamedInputConverter<List<T>, T?, Int> , SlashCommandConverter

Abstract base class for an optional coalescing converter.

Link copied to clipboard
abstract class OptionalConverter<T : Any>(val outputError: Boolean = false, var validator: Validator<T?> = null) : SingleNamedInputConverter<T, T?, Boolean> , SlashCommandConverter

Abstract base class for an optional single converter.

Link copied to clipboard
abstract class SingleConverter<T : Any>(var validator: Validator<T> = null) : SingleNamedInputConverter<T, T, Boolean> , SlashCommandConverter

Abstract base class for a single converter.

Link copied to clipboard
class SingleToDefaultingConverter<T : Any>(val singleConverter: SingleConverter<T>, defaultValue: T, outputError: Boolean = false, newSignatureType: Key? = null, newShowTypeInSignature: Boolean? = null, newErrorType: Key? = null, var validator: Validator<T> = null) : DefaultingConverter<T>

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.

Link copied to clipboard
class SingleToListConverter<T : Any>(required: Boolean = true, val singleConverter: SingleConverter<T>, newSignatureType: Key? = null, newShowTypeInSignature: Boolean? = null, newErrorType: Key? = null, var validator: Validator<List<T>> = null) : ListConverter<T>

A special ListConverter that wraps a SingleConverter, effectively turning it into a list-handling converter with the same logic.

Link copied to clipboard
class SingleToOptionalConverter<T : Any>(val singleConverter: SingleConverter<T>, newSignatureType: Key? = null, newShowTypeInSignature: Boolean? = null, newErrorType: Key? = null, outputError: Boolean = false, var validator: Validator<T?> = null) : OptionalConverter<T>

A special OptionalConverter that wraps a SingleConverter, effectively turning it into an optional converter with the same logic.

Link copied to clipboard

Interface representing converters that can be made use of in slash commands.

Link copied to clipboard
typealias Validator<T> = suspend ValidationContext<T>.() -> Unit?

Type alias representing a validator callable. Keeps things relatively maintainable.