LavaKord

interface LavaKord : CoroutineScope, EventSource<Event>

Representation of a Lavalink cluster.

Properties

Link copied to clipboard
Link copied to clipboard
open override val coroutineScope: CoroutineScope

This simply returns this. It is required for implementations of EventSource

Link copied to clipboard
abstract override val events: Flow<Event>

A merged Flow of Events produced by this instance's Nodes

Link copied to clipboard
abstract val nodes: List<Node>

list of Nodes in this cluster

Link copied to clipboard
abstract val options: LavaKordOptions

Configuration options (See LavaKordOptions

Link copied to clipboard
abstract val userId: ULong

the id of the Discord bot user

Functions

Link copied to clipboard
abstract fun addNode(serverUri: Url, password: String, name: String? = null, session: String? = null)
open fun addNode(serverUri: String, password: String, name: String? = null, session: String? = null)

Adds a new node to this cluster.

Link copied to clipboard
abstract fun createRestNode(serverUri: Url, password: String, name: String? = null): RestNode

Creates and returns a new rest-only node.

Link copied to clipboard
open fun getLink(guildId: String): Link
abstract fun getLink(guildId: ULong): Link

Returns the corresponding Link for the guildId.

Link copied to clipboard
inline fun <T : Any, E : T> EventSource<T>.on(scope: CoroutineScope = coroutineScope, noinline consumer: suspend E.() -> Unit): Job

Convenience method that will invoke the consumer on every event T created by EventSource.events.

inline fun <T : Event> EventSource<Event>.on(scope: CoroutineScope = coroutineScope, noinline consumer: suspend T.() -> Unit): Job

Listens for a TrackEvent

Link copied to clipboard
open fun removeNode(node: Node)

Removes the node.

abstract fun removeNode(name: String)

Removes a node from the cluster by its name.