DefaultSlashCommandClient

open class DefaultSlashCommandClient(packageName: String) : SlashCommandClient, CoroutineScope

Extendable coroutine based SlashCommandClient

See also

Parameters

packageName

The package name where commands are located (me.example.commands)

Constructors

DefaultSlashCommandClient
Link copied to clipboard
fun DefaultSlashCommandClient(packageName: String)

Functions

createContext
Link copied to clipboard
open suspend fun createContext(event: SlashCommandEvent, command: BaseSlashCommand): SlashCommandContext
getCommand
Link copied to clipboard
open fun getCommand(name: String): BaseSlashCommand?
onEvent
Link copied to clipboard
open override fun onEvent(event: GenericEvent)
onGenericException
Link copied to clipboard
open fun onGenericException(context: SlashCommandContext, command: BaseSlashCommand, ex: Exception)

Executed when a command return an exception

onPermissionsLackException
Link copied to clipboard
open fun onPermissionsLackException(ex: PermissionsLackException)

Executed when an interaction event does not meet the required permissions.

onSlashCommandEvent
Link copied to clipboard
open override fun onSlashCommandEvent(event: SlashCommandEvent)

Handled when discord send an SlashCommandEvent

withJDA
Link copied to clipboard
open fun withJDA(jda: JDA)

Register the event listener to receive SlashCommandEvent from your JDA shard.

withMetrics
Link copied to clipboard
open fun withMetrics()

Enable prometheus metrics exporters

withShardManager
Link copied to clipboard
open fun withShardManager(shardManager: ShardManager)

Register the event listener to receive SlashCommandEvent from your ShardManager.

Properties

coroutineContext
Link copied to clipboard
open override val coroutineContext: CoroutineContext
registry
Link copied to clipboard
open override val registry: List<BaseSlashCommand>

The command registry.