Package cloud.commandframework.kotlin.extension

Extension functions for existing Cloud types

Functions

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

Get a ArgumentDescription, defaulting to ArgumentDescription.empty

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

command
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

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

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

Get a Description, defaulting to Description.empty

mutate
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.

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

Specify a required sender type

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

Create a new MutableCommandBuilder.