Command

sealed interface Command

Inheritors

Properties

Link copied to clipboard
abstract val category: String

The category that this command belongs to - set automatically by CommandSet.

Link copied to clipboard
abstract val description: String

A brief description of the command - used in documentation.

Link copied to clipboard

The list of Execution that this command can be run with.

Link copied to clipboard
abstract val name: String

The name of this command.

Link copied to clipboard
open val names: List<String>

All names (aliases) of this command.

Link copied to clipboard
abstract val requiredPermissions: Permissions

The permission level required to use this command.

Functions

Link copied to clipboard
open fun <T : CommandEvent<*>> addExecution(argTypes: List<Argument<*, *>>, execute: suspend T.() -> Unit)

Add an Execution to this Command. Called automatically by each execute block. You should not need to call this manually.

Link copied to clipboard
open suspend fun canParse(context: DiscordContext, execution: Execution<*>, args: List<String>): Boolean

Whether the command can parse the given arguments into a container.

Link copied to clipboard
open suspend fun hasPermissionToRun(discord: Discord, author: User, guild: Guild?): Boolean

Whether this command has permission to run with the given event.

Link copied to clipboard
open fun invoke(event: CommandEvent<TypeContainer>, args: List<String>)

Invoke this command with the given args.

Link copied to clipboard
suspend fun Command.mentionOrNull(guild: Guild): String?

Create a discord mention for this command.