BContext

@InterfacedService(acceptMultiple = false)
interface BContext(source)

Main context for BotCommands framework.

Types

Link copied to clipboard

Initialization status of the framework.

Properties

Link copied to clipboard
Link copied to clipboard

Returns the application commands context, this is for user/message/slash commands and related methods

Link copied to clipboard
Link copied to clipboard
abstract val botOwners: BotOwners

Returns the BotOwners service.

Link copied to clipboard
Link copied to clipboard
abstract val config: BConfig
Link copied to clipboard

Returns the EventDispatcher service.

Link copied to clipboard

Returns the global exception handler, used to handle errors caught by the framework, or null if none exists.

Link copied to clipboard
open val jda: JDA

Returns the JDA instance associated with this context.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the ServiceContainer service.

Link copied to clipboard
abstract val status: BContext.Status

Returns the initialization status of the framework.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
open fun dispatchException(message: String, t: Throwable?)
abstract fun dispatchException(message: String, t: Throwable?, extraContext: Map<String, Any?>)

Sends an exception message to the bot owners.

Link copied to clipboard
abstract fun getExceptionContent(message: String, t: Throwable?, extraContext: Map<String, Any?>): String

Gets the message that would be sent by dispatchException.

Link copied to clipboard

Filters out interfaced services of that type if they are already being inspected.

Link copied to clipboard

Filters out interfaced services of that type if they are already being inspected.

Link copied to clipboard
open fun <T : Any> getService(clazz: Class<T>): T
Link copied to clipboard
inline fun <T : Any> BContext.getService(): T
fun <T : Any> BContext.getService(kClass: KClass<T>): T
Link copied to clipboard
inline fun <T : Any> BContext.getServiceOrNull(): T?
fun <T : Any> BContext.getServiceOrNull(kClass: KClass<T>): T?
Link copied to clipboard
open fun <T : Any> tryGetService(clazz: Class<T>): ServiceResult<T>
Link copied to clipboard