Package-level declarations

Types

Link copied to clipboard
class EphemeralSlashCommand<A : Arguments, M : ModalForm>(extension: Extension, val arguments: () -> A? = null, val modal: () -> M? = null, val parentCommand: SlashCommand<*, *, *>? = null, val parentGroup: SlashGroup? = null) : SlashCommand<EphemeralSlashCommandContext<A, M>, A, M>

Ephemeral slash command.

Link copied to clipboard
class EphemeralSlashCommandContext<A : Arguments, M : ModalForm>(val event: ChatInputCommandInteractionCreateEvent, val command: SlashCommand<EphemeralSlashCommandContext<A, M>, A, M>, val interactionResponse: EphemeralMessageInteractionResponseBehavior, cache: MutableStringKeyedMap<Any>) : SlashCommandContext<EphemeralSlashCommandContext<A, M>, A, M> , EphemeralInteractionContext

Ephemeral-only slash command context.

Link copied to clipboard
typealias InitialEphemeralSlashResponseBuilder = suspend InteractionResponseCreateBuilder.(ChatInputCommandInteractionCreateEvent) -> Unit?
Link copied to clipboard
typealias InitialPublicSlashResponseBehavior = suspend InteractionResponseCreateBuilder.(ChatInputCommandInteractionCreateEvent) -> Unit?
Link copied to clipboard
class PublicSlashCommand<A : Arguments, M : ModalForm>(extension: Extension, val arguments: () -> A? = null, val modal: () -> M? = null, val parentCommand: SlashCommand<*, *, *>? = null, val parentGroup: SlashGroup? = null) : SlashCommand<PublicSlashCommandContext<A, M>, A, M>

Public slash command.

Link copied to clipboard
class PublicSlashCommandContext<A : Arguments, M : ModalForm>(val event: ChatInputCommandInteractionCreateEvent, val command: SlashCommand<PublicSlashCommandContext<A, M>, A, M>, val interactionResponse: PublicMessageInteractionResponseBehavior, cache: MutableStringKeyedMap<Any>) : SlashCommandContext<PublicSlashCommandContext<A, M>, A, M> , PublicInteractionContext

Public-only slash command context.

Link copied to clipboard
abstract class SlashCommand<C : SlashCommandContext<*, A, M>, A : Arguments, M : ModalForm>(extension: Extension, val arguments: () -> A? = null, val modal: () -> M? = null, val parentCommand: SlashCommand<*, *, *>? = null, val parentGroup: SlashGroup? = null) : ApplicationCommand<ChatInputCommandInteractionCreateEvent>

Slash command, executed directly in the chat input.

Link copied to clipboard
open class SlashCommandContext<C : SlashCommandContext<C, A, M>, A : Arguments, M : ModalForm>(val event: ChatInputCommandInteractionCreateEvent, val command: SlashCommand<C, A, M>, val cache: MutableStringKeyedMap<Any>) : ApplicationCommandContext

Slash command context, containing everything you need for your slash command's execution.

Link copied to clipboard

Parser in charge of dealing with the arguments for slash commands.

Link copied to clipboard
class SlashGroup(val name: Key, val parent: SlashCommand<*, *, *>) : KordExKoinComponent

Slash command group, containing other slash commands.

Functions

Link copied to clipboard

Function for registering a custom ephemeral slash command object, for subcommands.

DSL function for easily registering an ephemeral subcommand, without arguments.

suspend fun <T : Arguments> SlashCommand<*, *, *>.ephemeralSubCommand(arguments: () -> T, body: suspend EphemeralSlashCommand<T, ModalForm>.() -> Unit): EphemeralSlashCommand<T, ModalForm>
suspend fun <T : Arguments> SlashGroup.ephemeralSubCommand(arguments: () -> T, body: suspend EphemeralSlashCommand<T, ModalForm>.() -> Unit): EphemeralSlashCommand<T, ModalForm>
suspend fun <T : Arguments, M : ModalForm> SlashGroup.ephemeralSubCommand(arguments: () -> T, modal: () -> M, body: suspend EphemeralSlashCommand<T, M>.() -> Unit): EphemeralSlashCommand<T, M>

DSL function for easily registering an ephemeral subcommand, with arguments.

@JvmName(name = "ephemeralSubCommand1")
suspend fun <M : ModalForm> SlashCommand<*, *, *>.ephemeralSubCommand(modal: () -> M, body: suspend EphemeralSlashCommand<Arguments, M>.() -> Unit): EphemeralSlashCommand<Arguments, M>
suspend fun <A : Arguments, M : ModalForm> SlashCommand<*, *, *>.ephemeralSubCommand(arguments: () -> A, modal: () -> M, body: suspend EphemeralSlashCommand<A, M>.() -> Unit): EphemeralSlashCommand<A, M>

DSL function for easily registering an ephemeral subcommand, with a modal form.

@JvmName(name = "ephemeralSubCommand1")
suspend fun <M : ModalForm> SlashGroup.ephemeralSubCommand(modal: () -> M, body: suspend EphemeralSlashCommand<Arguments, M>.() -> Unit): EphemeralSlashCommand<Arguments, M>

DSL function for easily registering an ephemeral subcommand, with a modal.

Link copied to clipboard
suspend fun SlashCommand<*, *, *>.group(name: Key, body: suspend SlashGroup.() -> Unit): SlashGroup

Create a command group, using the given name.

Link copied to clipboard

Function for registering a custom public slash command object, for subcommands.

DSL function for easily registering a public subcommand, without arguments.

suspend fun <T : Arguments> SlashCommand<*, *, *>.publicSubCommand(arguments: () -> T, body: suspend PublicSlashCommand<T, ModalForm>.() -> Unit): PublicSlashCommand<T, ModalForm>
suspend fun <T : Arguments> SlashGroup.publicSubCommand(arguments: () -> T, body: suspend PublicSlashCommand<T, ModalForm>.() -> Unit): PublicSlashCommand<T, ModalForm>
suspend fun <T : Arguments, M : ModalForm> SlashGroup.publicSubCommand(arguments: () -> T, modal: () -> M, body: suspend PublicSlashCommand<T, M>.() -> Unit): PublicSlashCommand<T, M>

DSL function for easily registering a public subcommand, with arguments.

@JvmName(name = "publicSubCommand1")
suspend fun <M : ModalForm> SlashCommand<*, *, *>.publicSubCommand(modal: () -> M, body: suspend PublicSlashCommand<Arguments, M>.() -> Unit): PublicSlashCommand<Arguments, M>

DSL function for easily registering a public subcommand, with a modal form.

@JvmName(name = "publicSubCommand1")
suspend fun <M : ModalForm> SlashGroup.publicSubCommand(modal: () -> M, body: suspend PublicSlashCommand<Arguments, M>.() -> Unit): PublicSlashCommand<Arguments, M>

DSL function for easily registering a public subcommand, with a modal.

suspend fun <A : Arguments, M : ModalForm> SlashCommand<*, *, *>.publicSubCommand(arguments: () -> A, modal: () -> M, body: suspend PublicSlashCommand<A, M>.() -> Unit): PublicSlashCommand<A, M>

DSL function for easily registering a public subcommand, with arguments and a modal form.