slashCommand
fun slashCommand(name: String, function: KFunction<Any>?, builder: TopLevelSlashCommandBuilder.() -> Unit)(source)
Declares the supplied function as a slash command. For subcommands and subcommand groups, use ofSubcommands instead.
See the Discord docs on which paths are allowed.
The default allowed interaction contexts and integration types can be redefined in the corresponding command manager.
Requirements
The first parameter must be:
GuildSlashEvent if the interaction context only contains InteractionContextType.GUILD.
GlobalSlashEvent in other cases.
See also
@JDASlashCommand