UnsafeSlashCommand

class UnsafeSlashCommand<A : Arguments, M : UnsafeModalForm>(extension: Extension, val arguments: () -> A? = null, val modal: () -> M? = null, val parentCommand: SlashCommand<*, *, *>? = null, val parentGroup: SlashGroup? = null) : SlashCommand<UnsafeCommandSlashCommandContext<A, M>, A, M>

Like a standard slash command, but with less safety features.

Constructors

Link copied to clipboard
constructor(extension: Extension, arguments: () -> A? = null, modal: () -> M? = null, parentCommand: SlashCommand<*, *, *>? = null, parentGroup: SlashGroup? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val arguments: () -> A? = null
Link copied to clipboard
lateinit var body: suspend UnsafeCommandSlashCommandContext<A, M>.(M?) -> Unit
Link copied to clipboard
Link copied to clipboard
open val checkList: MutableList<CheckWithCache<ChatInputCommandInteractionCreateEvent>>
Link copied to clipboard
Link copied to clipboard
open var defaultMemberPermissions: Permissions?
Link copied to clipboard
open lateinit var description: Key
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var guildId: Snowflake?
Link copied to clipboard
open val hasBody: Boolean
Link copied to clipboard

Initial response type. Change this to decide what happens when this slash command is executed.

Link copied to clipboard
val kord: Kord
Link copied to clipboard
val kxLogger: KLogger
Link copied to clipboard
Link copied to clipboard
open override var locking: Boolean
Link copied to clipboard
Link copied to clipboard
open override val modal: () -> M? = null
Link copied to clipboard
open override var mutex: Mutex?
Link copied to clipboard
open lateinit var name: Key
Link copied to clipboard
Link copied to clipboard
open override val parentCommand: SlashCommand<*, *, *>? = null
Link copied to clipboard
open override val parentGroup: SlashGroup? = null
Link copied to clipboard
Link copied to clipboard
open override val requiredPerms: MutableSet<Permission>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val type: ApplicationCommandType

Functions

Link copied to clipboard
fun action(action: suspend UnsafeCommandSlashCommandContext<A, M>.(M?) -> Unit)
Link copied to clipboard
open suspend override fun call(event: ChatInputCommandInteractionCreateEvent, cache: <Error class: unknown class><Any>)
Link copied to clipboard
open fun check(vararg checks: CheckWithCache<ChatInputCommandInteractionCreateEvent>)
open fun check(check: CheckWithCache<ChatInputCommandInteractionCreateEvent>)
Link copied to clipboard
open suspend fun checkBotPerms(context: CommandContext)
Link copied to clipboard
open suspend fun doCall(event: ChatInputCommandInteractionCreateEvent)
Link copied to clipboard
open suspend fun emitEventAsync(event: CommandEvent<*, *>): Job
Link copied to clipboard
open fun findCommand(eventCommand: InteractionCommand): SlashCommand<*, *, *>
open fun findCommand(event: AutoCompleteInteractionCreateEvent): SlashCommand<*, *, *>
open fun findCommand(event: ChatInputCommandInteractionCreateEvent): SlashCommand<*, *, *>
Link copied to clipboard
open suspend fun firstSentryBreadcrumb(context: UnsafeCommandSlashCommandContext<A, M>, commandObj: SlashCommand<*, *, *>)
Link copied to clipboard
open override fun getKoin(): Koin
Link copied to clipboard
open fun guild(guild: Snowflake?)
Link copied to clipboard
open suspend fun handleError(context: UnsafeCommandSlashCommandContext<A, M>, t: Throwable, commandObj: SlashCommand<*, *, *>)
Link copied to clipboard
fun localise(key: Key, lowerCase: Boolean): Localised<String>
Link copied to clipboard
open suspend fun lock()
Link copied to clipboard
fun requireBotPermissions(perms: Permissions)
fun requireBotPermissions(vararg perms: Permission)
Link copied to clipboard
fun requirePermission(vararg permissions: Permission)
Link copied to clipboard
open suspend override fun respondText(context: UnsafeCommandSlashCommandContext<A, M>, message: Key, failureType: FailureReason<*>)
Link copied to clipboard
open suspend override fun run(event: ChatInputCommandInteractionCreateEvent, cache: <Error class: unknown class><Any>)
Link copied to clipboard
open suspend override fun runChecks(event: ChatInputCommandInteractionCreateEvent, cache: MutableStringKeyedMap<Any>): Boolean
Link copied to clipboard
open suspend fun runStandardChecks(event: ChatInputCommandInteractionCreateEvent, cache: MutableStringKeyedMap<Any>): Boolean
Link copied to clipboard
open fun unlock()
Link copied to clipboard

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

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

suspend fun <T : Arguments> SlashCommand<*, *, *>.unsafeSubCommand(arguments: () -> T, body: suspend UnsafeSlashCommand<T, UnsafeModalForm>.() -> Unit): UnsafeSlashCommand<T, UnsafeModalForm>

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

Link copied to clipboard
open override fun validate()
Link copied to clipboard
open suspend fun <T> withLock(body: suspend () -> T)