WrappedArgument

interface WrappedArgument<Input, Output, Input2, Output2> : Argument<Input2, Output2>

An Argument that wraps around another argument.

Functions

Link copied to clipboard
open suspend override fun generateExamples(context: DiscordContext): List<String>

A function called whenever an example of this type is needed.

Link copied to clipboard
open fun isOptional(): Boolean

Utility function to check that this Argument is an OptionalArg.

Link copied to clipboard
open fun multiple(): MultipleArg<Input2, Output2>

Accept multiple inputs of this Argument.

Link copied to clipboard
open fun optional(default: Output2): OptionalArg<Input2, Output2, Output2>

Make this argument optional and fall back to the default value if the conversion fails.

open fun optional(default: suspend (DiscordContext) -> Output2): OptionalArg<Input2, Output2, Output2>

Make this argument optional and fall back to the default value if the conversion fails. Exposes a CommandEvent.

Link copied to clipboard
open fun optionalNullable(default: Output2? = null): OptionalArg<Input2, Output2, Output2?>

Make this argument optional and fall back to the default value if the conversion fails.

open fun optionalNullable(default: suspend (DiscordContext) -> Output2?): OptionalArg<Input2, Output2, Output2?>

Make this argument optional and fall back to the default value if the conversion fails. Exposes a CommandEvent.

Link copied to clipboard
open suspend override fun parse(args: MutableList<String>, discord: Discord): Input2?

Parse string input into the correct type handled by this argument.

Link copied to clipboard
open suspend fun transform(input: Input2, context: DiscordContext): Result<Output2>

Transforms a value produced by a slash command or by the parse function.

Properties

Link copied to clipboard
abstract val description: String

A description of the data that this type represents.

Link copied to clipboard
open val innerType: Argument<Input, Output>

Get the innermost/raw type inside this argument.

Link copied to clipboard
abstract val name: String

The display name for this type in documentations and examples.

Link copied to clipboard
abstract val type: Argument<Input, Output>

The Argument that is wrapped.

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
inline fun <T> WrappedArgument<*, *, *, *>.containsType(): Boolean

Perform a nested search on this wrapped argument to check for a certain type.