Cluster class

Cluster of lavalink nodes

Constructors

Cluster(Nyxx _client, Snowflake _clientId, [Level? loggingLevel])
Creates a new cluster ready to start adding connections

Properties

bestNode Node
Get the best available node, it is recommended to use getOrCreatePlayerNode instead as this won't create the player itself if it doesn't exists
no setter
connectedNodes UnmodifiableMapView<int, Node>
Returns a map with the nodes connected to lavalink cluster
no setter
disconnectedNodes UnmodifiableMapView<int, Node>
Returns a map with the nodes that are actually disconnected from lavalink
no setter
hashCode int
The hash code for this object.
no setterinherited
onPlayerUpdate Stream<PlayerUpdateEvent>
Emitted when a player gets updated
latefinal
onStatsReceived Stream<StatsEvent>
Emitted when stats are sent from lavalink
latefinal
onTrackEnd Stream<TrackEndEvent>
Emitted when a track ends playing
latefinal
onTrackException Stream<TrackExceptionEvent>
Emitted when a track gets an exception during playback
latefinal
onTrackStart Stream<TrackStartEvent>
Emitted when a track starts playing
latefinal
onTrackStuck Stream<TrackStuckEvent>
Emitted when a track gets stuck
latefinal
onWebSocketClosed Stream<WebSocketClosedEvent>
Emitted when a web socket is closed
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addNode(NodeOptions options) Future<void>
Adds and initializes a node
getDisconnectedNode(int nodeId) Node?
Attempts to retrieve a node disconnected from lavalink by its id, this method does not work with nodes that have exceeded the maximum reconnect attempts as those get removed from cluster
getOrCreatePlayerNode(Snowflake guildId) Node
Attempts to get the node containing a player for a specific guild id
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited