CommandEvent

open class CommandEvent<T : TypeContainer>(val rawInputs: RawInputs, val discord: Discord, val message: Message?, val author: User, val channel: MessageChannel, val guild: Guild?) : Responder

A generic command execution event.

Inheritors

Constructors

Link copied to clipboard
constructor(rawInputs: RawInputs, discord: Discord, message: Message?, author: User, channel: MessageChannel, guild: Guild?)

Properties

Link copied to clipboard
lateinit var args: T

The parsed input to the command.

Link copied to clipboard
open val author: User

The User who invoked this command.

Link copied to clipboard
open override val channel: MessageChannel

The MessageChannel this command was invoked in.

Link copied to clipboard

The Command that is resolved from the invocation.

Link copied to clipboard

The DiscordContext of this event.

Link copied to clipboard
open val discord: Discord

The Discord instance.

Link copied to clipboard
open val guild: Guild?

The (nullable) guild this command was invoked in.

Link copied to clipboard
open val message: Message?

The Message that invoked this command.

Link copied to clipboard

The RawInputs of the command.

Functions

Link copied to clipboard
open fun clone(input: RawInputs): CommandEvent<T>

Clone this event's context data with new inputs.

Link copied to clipboard
suspend fun getMember(): Member?

Try to resolve the member from the user/guild data.

Link copied to clipboard
suspend fun prefix(): String

Determine the relevant prefix in the current context.

Link copied to clipboard
suspend fun reactWith(emoji: DiscordEmoji): Unit?

Add a reaction to the command invocation message.

Link copied to clipboard
open suspend fun respond(message: Any = "", embed: suspend EmbedBuilder.() -> Unit? = null): Message?

Create a response message with text and/or an embed.

Link copied to clipboard
open suspend fun respondMenu(menuBuilder: suspend MenuBuilder.() -> Unit): Message

Respond with a Menu.