ContextEvent

data class ContextEvent<T>(val rawInputs: RawInputs, val discord: Discord, val message: Message?, val author: User, val channel: MessageChannel, val guild: Guild, val interaction: GuildApplicationCommandInteraction?, val arg: T) : SlashCommandEvent<Args1<T>> , SlashResponder

An event fired by a contextual slash command.

Constructors

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

Properties

Link copied to clipboard
val arg: T

The single argument passed to this context command.

Link copied to clipboard
lateinit var args: Args1<T>

The parsed input to the command.

Link copied to clipboard
open override 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 override val discord: Discord

The Discord instance.

Link copied to clipboard
open override val guild: Guild

The (nullable) guild this command was invoked in.

Link copied to clipboard
open override val interaction: GuildApplicationCommandInteraction?
Link copied to clipboard
open override val message: Message?

The Message that invoked this command.

Link copied to clipboard
open override val rawInputs: RawInputs

The RawInputs of the command.

Functions

Link copied to clipboard
open fun clone(input: RawInputs): CommandEvent<Args1<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?): Message?

Create an ephemeral slash response with text and/or an embed.

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

Respond with a Menu.

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

Create a public slash response with text and/or an embed.