publicSlashCommand

suspend fun <T : Arguments> Extension.publicSlashCommand(arguments: () -> T, body: suspend PublicSlashCommand<T, ModalForm>.() -> Unit): PublicSlashCommand<T, ModalForm>

DSL function for easily registering a public slash command, with arguments.

Use this in your setup function to register a slash command that may be executed on Discord.

Parameters

arguments

Arguments builder (probably a reference to the class constructor).

body

Builder lambda used for setting up the slash command object.


@JvmName(name = "publicSlashCommand1")
suspend fun <M : ModalForm> Extension.publicSlashCommand(modal: () -> M, body: suspend PublicSlashCommand<Arguments, M>.() -> Unit): PublicSlashCommand<Arguments, M>

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

Use this in your setup function to register a slash command that may be executed on Discord.

Parameters

modal

ModalForm builder (probably a reference to the class constructor).

body

Builder lambda used for setting up the slash command object.


suspend fun <A : Arguments, M : ModalForm> Extension.publicSlashCommand(arguments: () -> A, modal: () -> M, body: suspend PublicSlashCommand<A, M>.() -> Unit): PublicSlashCommand<A, M>

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

Use this in your setup function to register a slash command that may be executed on Discord.

Parameters

arguments

Arguments builder (probably a reference to the class constructor).

modal

ModalForm builder (probably a reference to the class constructor).

body

Builder lambda used for setting up the slash command object.


Function for registering a custom public slash command object.

You can use this if you have a custom public slash command subclass you need to register.

Parameters

commandObj

PublicSlashCommand object to register.


DSL function for easily registering a public slash command, without arguments.

Use this in your setup function to register a slash command that may be executed on Discord.

Parameters

body

Builder lambda used for setting up the slash command object.