LavalinkNode

class LavalinkNode(nodeOptions: NodeOptions, val lavalink: LavalinkClient) : Disposable, Closeable

The Node is a physical instance of the lavalink server software.

Constructors

Link copied to clipboard
constructor(nodeOptions: NodeOptions, lavalink: LavalinkClient)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val flux: Flux<ClientEvent>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var stats: Stats?
Link copied to clipboard

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard

Creates or updates a player.

Link copied to clipboard
inline fun <T> customJsonRequest(builderFn: UnaryOperator<HttpBuilder>): Mono<T>
fun <T> customJsonRequest(decodeTo: Class<T>, builderFn: UnaryOperator<HttpBuilder>): Mono<T>
fun <T> customJsonRequest(deserializer: DeserializationStrategy<T>, builderFn: UnaryOperator<HttpBuilder>): Mono<T>

Send a custom request to the lavalink node. Any host and port you set will be replaced with the node host automatically. The scheme must match your node's scheme, however. The response body will be deserialized using the provided deserializer.

Link copied to clipboard
fun customRequest(builderFn: UnaryOperator<HttpBuilder>): Mono<Response>

Send a custom request to the lavalink node. Any host and port you set will be replaced with the node host automatically. The scheme must match your node's scheme, however.

Link copied to clipboard
fun decodeTrack(encoded: String): Mono<Track>

Uses the node to decode a base64 encoded track.

Link copied to clipboard
fun decodeTracks(encoded: List<String>): Mono<List<Track>>

Uses the node to decode a list of base64 encoded tracks.

Link copied to clipboard
fun destroyPlayerAndLink(guildId: Long): Mono<Unit>

Destroy a guild's player and remove it from the cache. This will also remove the associated link from the client.

Link copied to clipboard
open override fun dispose()
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Get a LavalinkPlayer from the player cache.

Link copied to clipboard
fun getNodeInfo(): Mono<Info>

Get information about the node.

Link copied to clipboard
fun getPlayer(guildId: Long): Mono<LavalinkPlayer>

Gets the player from the guild id. If the player is not cached, it will be retrieved from the server. If the player does not exist on the node, it will be created.

Link copied to clipboard

Retrieves a list of all players from the lavalink node.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open fun isDisposed(): Boolean
Link copied to clipboard
fun loadItem(identifier: String): Mono<LavalinkLoadResult>

Load an item for the player.

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

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

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun updatePlayer(guildId: Long, updateConsumer: Consumer<PlayerUpdateBuilder>): Mono<LavalinkPlayer>