Package-level declarations

Properties

Link copied to clipboard
var <C, T> CommandComponent.Builder<C, T>.defaultValue: DefaultValue<C, T>?

The default value of the command component.

Link copied to clipboard
var <C, T> CommandComponent.Builder<C, T>.description: Description

The description of the command component.

Link copied to clipboard
var <C, T> CommandComponent.Builder<C, T>.name: String

The name of the command component.

Link copied to clipboard
var <C, T> CommandComponent.Builder<C, T>.parser: ParserDescriptor<C, T>

The parser of the command component.

Link copied to clipboard
var <C, T> CommandComponent.Builder<C, T>.suggestionProvider: SuggestionProvider<C>

The suggestion provider of the command component.

Link copied to clipboard
var <C, T> CommandComponent.Builder<C, T>.textDescription: String

The description of the command component.

Functions

Link copied to clipboard
fun argumentDescription(description: String = ""): Description

Get a Description, defaulting to Description.empty

Link copied to clipboard
inline fun <C, T> ArgumentParser<C, T>.asDescriptor(): ParserDescriptor<C, T>

Returns a ParserDescriptor that describes this parser.

Link copied to clipboard
fun <C : Any> CommandManager<C>.buildAndRegister(name: String, description: Description = Description.empty(), aliases: Array<String> = emptyArray(), lambda: MutableCommandBuilder<C>.() -> Unit): MutableCommandBuilder<C>

Create a new MutableCommandBuilder which will invoke the provided receiver lambda, and then register itself with the owning CommandManager

Link copied to clipboard
inline fun <T : Any> cloudKey(name: String): CloudKey<T>

Creates a new key with the given name.

Link copied to clipboard
fun <C : Any> CommandManager<C>.command(vararg commands: MutableCommandBuilder<C>): CommandManager<C>

Build the provided MutableCommandBuilders into Commands, and then register them with the command manager

Link copied to clipboard
fun <C : Any> CommandManager<C>.commandBuilder(name: String, description: Description = Description.empty(), aliases: Array<String> = emptyArray(), lambda: MutableCommandBuilder<C>.() -> Unit): MutableCommandBuilder<C>

Create a new MutableCommandBuilder and invoke the provided receiver lambda on it

Link copied to clipboard
fun <T : Any> ArgumentParseResult<T>.component1(): T?

Returns the ArgumentParseResult.parsedValue, or null.

operator fun <U : Any, V : Any> Either<U, V>.component1(): U?

Returns the Either.primary value, or null.

Link copied to clipboard
fun <T : Any> ArgumentParseResult<T>.component2(): Throwable?

Returns the ArgumentParseResult.failure, or null.

operator fun <U : Any, V : Any> Either<U, V>.component2(): V?

Returns the Either.fallback value, or null.

Link copied to clipboard
inline fun <C, T, O> ParserDescriptor<C, T>.flatMap(mapper: MappedArgumentParser.Mapper<C, T, O>): ParserDescriptor<C, O>

Creates a descriptor for a flat-mapped parser.

Link copied to clipboard
inline fun <C, T, O> ParserDescriptor<C, T>.flatMapSuccess(noinline mapper: (CommandContext<C>, T) -> CompletableFuture<ArgumentParseResult<O>>): ParserDescriptor<C, O>

Creates a descriptor for a flat-mapped parser.

Link copied to clipboard
fun <T : Any> CloudKeyContainer.getOrNull(key: String): T?
fun <T : Any> CloudKeyContainer.getOrNull(key: CloudKey<T>): T?

Returns the value associated with the given key, if it exists.

fun <T : Any> CloudKeyContainer.getOrNull(keyHolder: CloudKeyHolder<T>): T?

Returns the value associated with the given keyHolder, if it exists.

Link copied to clipboard
inline fun <C, T, O> ParserDescriptor<C, T>.mapSuccess(noinline mapper: (CommandContext<C>, T) -> CompletableFuture<O>): ParserDescriptor<C, O>

Creates a descriptor for a mapped parser.

Link copied to clipboard
fun <C : Any> Command.Builder<C>.mutate(commandManager: CommandManager<C>, lambda: MutableCommandBuilder<C>.() -> Unit): MutableCommandBuilder<C>

Create a new MutableCommandBuilder and invoke the provided receiver lambda on it.

Link copied to clipboard
inline fun <C, T> parserDescriptor(parser: ArgumentParser<C, T>): ParserDescriptor<C, T>

Returns a ParserDescriptor that describes the parser.

Link copied to clipboard
inline fun <C, T : Throwable> ExceptionController<C>.register(decorator: ExceptionHandlerRegistration.BuilderDecorator<C, T>): ExceptionController<C>

Decorates a registration builder using the given decorator and registers the result.

Link copied to clipboard
inline fun <C, T : Throwable> ExceptionController<C>.registerHandler(handler: ExceptionHandler<C, T>): ExceptionController<C>

Registers the given handler.

Link copied to clipboard
fun <C : Any> Command.Builder<C>.senderType(type: KClass<out C>): Command.Builder<C>

Specify a required sender type

Link copied to clipboard
fun <C : Any> Command.Builder<C>.toMutable(commandManager: CommandManager<C>): MutableCommandBuilder<C>

Create a new MutableCommandBuilder.

Link copied to clipboard
fun <C, T> AggregateParserBuilder<C>.withComponent(builderDecorator: CommandComponent.Builder<C, T>.() -> Unit): AggregateParserBuilder<C>

Creates a new command component using the given builderDecorator.