BooleanArgument

interface BooleanArgument<Output> : PrimitiveArgument<Boolean, Output>

An Argument that accepts a Boolean.

Functions

Link copied to clipboard
open fun autocomplete(choices: suspend AutocompleteData.() -> List<Boolean>): AutocompleteArg<Boolean, Output>

Offer autocomplete options for this argument.

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<Boolean, Output>

Accept multiple inputs of this Argument.

Link copied to clipboard
open fun optional(default: Output): OptionalArg<Boolean, Output, Output>

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

open fun optional(default: suspend (DiscordContext) -> Output): OptionalArg<Boolean, Output, Output>

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: Output? = null): OptionalArg<Boolean, Output, Output?>

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

open fun optionalNullable(default: suspend (DiscordContext) -> Output?): OptionalArg<Boolean, Output, Output?>

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): Boolean?

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

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

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
abstract val falseValue: String

The string value that results in false.

Link copied to clipboard
abstract val name: String

The display name for this type in documentations and examples.

Link copied to clipboard
abstract val truthValue: String

The string value that results in true.

Inheritors

Link copied to clipboard