Package-level declarations

Adds JDABuilder and DefaultShardManagerBuilder extensions to quickly get going with coroutines and jda-ktx.

Types

Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard

Can be used to enable or disable cache flags by using assignment operators.

Link copied to clipboard

Can be used to enable or disable intents by using assignment operators. Disabling intents using these operators will also disable the respective cache flags for convenience.

Link copied to clipboard
val JDA.scope: CoroutineScope
val ShardManager.scope: CoroutineScope

The coroutine scope used by the underlying CoroutineEventManager. If this instance does not use the coroutine event manager, this returns the default scope from getDefaultScope.

Functions

Link copied to clipboard
inline fun createJDA(token: String, enableCoroutines: Boolean = true, timeout: Duration = Duration.INFINITE, intents: Collection<GatewayIntent>, builder: JDABuilder.() -> Unit = {}): JDA
inline fun createJDA(token: String, enableCoroutines: Boolean = true, timeout: Duration = Duration.INFINITE, intent: GatewayIntent, vararg intents: GatewayIntent, builder: JDABuilder.() -> Unit = {}): JDA

Convenience method to call JDABuilder.create and apply a coroutine manager.

Link copied to clipboard
inline fun default(token: String, enableCoroutines: Boolean = true, timeout: Duration = Duration.INFINITE, builder: JDABuilder.() -> Unit = {}): JDA

Convenience method to call JDABuilder.createDefault and apply a coroutine manager. Uses the default intends provided by JDABuilder.createDefault.

inline fun default(token: String, enableCoroutines: Boolean = true, timeout: Duration = Duration.INFINITE, intents: Collection<GatewayIntent>, builder: JDABuilder.() -> Unit = {}): JDA
inline fun default(token: String, enableCoroutines: Boolean = true, timeout: Duration = Duration.INFINITE, intent: GatewayIntent, vararg intents: GatewayIntent, builder: JDABuilder.() -> Unit = {}): JDA

Convenience method to call JDABuilder.createDefault and apply a coroutine manager.

Link copied to clipboard
fun JDABuilder.injectKTX(timeout: Duration = Duration.INFINITE): JDABuilder

Applies the CoroutineEventManager to this builder.

Link copied to clipboard
inline fun light(token: String, enableCoroutines: Boolean = true, timeout: Duration = Duration.INFINITE, builder: JDABuilder.() -> Unit = {}): JDA

Convenience method to call JDABuilder.createLight and apply a coroutine manager. Uses the default intends provided by JDABuilder.createLight.

inline fun light(token: String, enableCoroutines: Boolean = true, timeout: Duration = Duration.INFINITE, intents: Collection<GatewayIntent>, builder: JDABuilder.() -> Unit = {}): JDA
inline fun light(token: String, enableCoroutines: Boolean = true, timeout: Duration = Duration.INFINITE, intent: GatewayIntent, vararg intents: GatewayIntent, builder: JDABuilder.() -> Unit = {}): JDA

Convenience method to call JDABuilder.createLight and apply a coroutine manager.