Package io.facet.core

Types

AttributeKey
Link copied to clipboard
class AttributeKey<T : Any>(name: String) : Comparable<AttributeKey<T>>

Key for an object that allows for type-safe code.

BotScope
Link copied to clipboard
object BotScope : CoroutineScope

The bot's coroutine scope, used as the root coroutine scope for event listeners.

EmptyConfig
Link copied to clipboard
object EmptyConfig
EventDispatcherFeature
Link copied to clipboard
abstract class EventDispatcherFeature<out TConfig : Any, TFeature : Any>(keyName: String, requiredFeatures: List<Feature<*, *, *>>) : Feature<EventDispatcher, TConfig, TFeature>
Feature
Link copied to clipboard
abstract class Feature<in A, out C : Any, F : Any>(keyName: String, requiredFeatures: List<Feature<*, *, *>>)

A feature is any code that can be installed into an object to improve its functionality.

Features
Link copied to clipboard
object Features : LinkedHashMap<AttributeKey<*>, Any>
GatewayFeature
Link copied to clipboard
abstract class GatewayFeature<out TConfig : Any, TFeature : Any>(keyName: String, requiredFeatures: List<Feature<*, *, *>>) : Feature<GatewayDiscordClient, TConfig, TFeature>
SuspendingVoiceConnectionRegistry
Link copied to clipboard
interface SuspendingVoiceConnectionRegistry

Functions

feature
Link copied to clipboard
fun <F : Any> GatewayDiscordClient.feature(feature: Feature<*, *, F>): F
fun <F : Any> EventDispatcher.feature(feature: EventDispatcherFeature<*, F>): F

Gets the currently installed Feature instance, if present. Throws an IllegalStateException if the requested feature is not installed.

featureOrNull
Link copied to clipboard
fun <F : Any> GatewayDiscordClient.featureOrNull(feature: Feature<*, *, F>): F?
fun <F : Any> EventDispatcher.featureOrNull(feature: EventDispatcherFeature<*, F>): F?

Gets the currently installed Feature instance, if present.

install
Link copied to clipboard
suspend fun <C : Any> GatewayDiscordClient.install(scope: CoroutineScope, feature: GatewayFeature<C, *>, config: C.() -> Unit = {})
suspend fun <C : Any> EventDispatcher.install(scope: CoroutineScope, feature: EventDispatcherFeature<C, *>, config: C.() -> Unit = {})

Installs a Feature into the DiscordClient. The feature is immediately set up, and any event listeners are registered. If applicable, the feature can be configured using the config block.

shutdown
Link copied to clipboard
suspend fun GatewayDiscordClient.shutdown()

Logs out of the gateway and cancels all running coroutines.

withPlugins
Link copied to clipboard
fun GatewayBootstrap<GatewayOptions>.withPlugins(configureBlock: suspend GatewayDiscordClient.(CoroutineScope) -> Unit): Mono<Void>

Configures the gateway client.

fun GatewayBootstrap<GatewayOptions>.withPlugins(configureBlock: suspend EventDispatcher.(CoroutineScope) -> Unit): GatewayBootstrap<GatewayOptions>

Configures the event dispatcher before any events can be received.