DmTextCommand

class DmTextCommand(val names: List<String>, var description: String = "", val category: String, var requiredPermissions: Permissions, val executions: MutableList<Execution<CommandEvent<*>>> = mutableListOf()) : TextCommand

A text command that can only be executed in a DM.

Constructors

Link copied to clipboard
constructor(names: List<String>, description: String = "", category: String, requiredPermissions: Permissions, executions: MutableList<Execution<CommandEvent<*>>> = mutableListOf())

Properties

Link copied to clipboard
open override val category: String

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

Link copied to clipboard
open override var 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
open override val name: String

The first provided name for a TextCommand.

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

All names (aliases) of this command.

Link copied to clipboard
open override var 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.