ApplicationCommandContext

sealed class ApplicationCommandContext : CoroutineScope

The context for an interaction with an application command.

Properties

channelId
Link copied to clipboard
val channelId: Snowflake

The ID of the channel where this command was used.

client
Link copied to clipboard
val client: GatewayDiscordClient

The gateway this event was dispatched from.

coroutineContext
Link copied to clipboard
open override val coroutineContext: CoroutineContext
event
Link copied to clipboard
open val event: ApplicationCommandInteractionEvent

The discord interaction event.

interaction
Link copied to clipboard
val interaction: Interaction

The discord interaction for this command context.

interactionResponse
Link copied to clipboard
val interactionResponse: GatewayInteractionResponse

The interaction followup handler.

user
Link copied to clipboard
val user: User

The user that invoked this command.

Inheritors

MessageCommandContext
Link copied to clipboard
SlashCommandContext
Link copied to clipboard
UserCommandContext
Link copied to clipboard

Extensions

acknowledge
Link copied to clipboard
suspend fun ApplicationCommandContext.acknowledge(ephemeral: Boolean = false)

Acknowledges the interaction indicating a response will be edited later. The user sees a loading state, visible to all participants in the invoking channel. For a "only you can see this" response, set ephemeral to true, or use acknowledgeEphemeral().

acknowledgeEphemeral
Link copied to clipboard
suspend fun ApplicationCommandContext.acknowledgeEphemeral()

Acknowledges the interaction indicating a response will be edited later. Only the invoking user sees a loading state.

deferReply
Link copied to clipboard
suspend fun ApplicationCommandContext.deferReply(ephemeral: Boolean = false)

Acknowledges the interaction indicating a response will be edited later. The user sees a loading state, visible to all participants in the invoking channel. For a "only you can see this" response, set ephemeral to true.

Sources

jvm source
Link copied to clipboard