SlashGroup

class SlashGroup(val name: Key, val parent: SlashCommand<*, *, *>) : KordExKoinComponent

Slash command group, containing other slash commands.

Parameters

name

Slash command group name

parent

Parent slash command that this group belongs to

Constructors

Link copied to clipboard
constructor(name: Key, parent: SlashCommand<*, *, *>)

Properties

Link copied to clipboard
lateinit var description: Key

Command group description, which is required and shown on Discord.

Link copied to clipboard

Translation cache, so we don't have to look up translations every time.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val name: Key
Link copied to clipboard
val parent: SlashCommand<*, *, *>
Link copied to clipboard

List of subcommands belonging to this group.

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> 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> 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
open override fun getKoin(): Koin

Get the associated Koin instance.

Link copied to clipboard

Return this group's description translated for the given locale, cached as required.

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> 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> SlashGroup.publicSubCommand(modal: () -> M, body: suspend PublicSlashCommand<Arguments, M>.() -> Unit): PublicSlashCommand<Arguments, M>

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

Link copied to clipboard
fun validate()

Validate this command group, ensuring it has everything it needs.