LavalinkClient

class LavalinkClient(val userId: Long) : Closeable, Disposable

Parameters

userId

ID of the bot for authenticating with Discord

Constructors

Link copied to clipboard
constructor(userId: Long)

Properties

Link copied to clipboard
val flux: Flux<ClientEvent<*>>
Link copied to clipboard

To determine the best node, we use a load balancer. It is recommended to not change the load balancer after you've connected to a voice channel.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun addNode(name: String, address: URI, password: String, regionFilter: IRegionFilter? = null): LavalinkNode

Add a node to the client.

Link copied to clipboard
open override fun close()

Close the client and disconnect all nodes.

Link copied to clipboard
open override fun dispose()
Link copied to clipboard
fun getLink(guildId: Long, region: VoiceRegion? = null): Link

Get or crate a link between a guild and a node.

Link copied to clipboard
fun getLinkIfCached(guildId: Long): Link?

Returns a Link if it exists in the cache. If we select a link for voice updates, we don't know the region yet.

Link copied to clipboard
open fun isDisposed(): Boolean
Link copied to clipboard
inline fun <T : ClientEvent<*>> on(): Flux<T>
fun <T : ClientEvent<*>> on(type: Class<T>): Flux<T>