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
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(nodeOptions: NodeOptions): 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 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
fun getOrCreateLink(guildId: Long, region: VoiceRegion? = null): Link

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

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>

Listen to events from all nodes. Please note that uncaught exceptions will cause the listener to stop emitting events.

Link copied to clipboard

Disconnect and remove a node the client.

Remove a node by its name.