LavalinkClient class

A client that connects to a Lavalink server, providing methods to control the server and exposing events received from the server.

Inheritance

Properties

base Uri
The URI relative to which API routes will be resolved.
finalinherited
clientName String
The name of this client.
finalinherited
connection LavalinkConnection
The websocket connection to the lavalink server, over which events are received.
no setter
hashCode int
The hash code for this object.
no setterinherited
httpClient → Client
The HTTP client used by this client.
finalinherited
password String
The password to use for authentication.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userId String
The user ID of this client.
final

Methods

close() Future<void>
Close this client and all associated resources.
override
decodeTrack(String encodedTrack) Future<Track>
Decode a track from its encoded form.
inherited
decodeTracks(List<String> encodedTracks) Future<List<Track>>
Decode multiple tracks from their encoded form.
inherited
deletePlayer(String guildId) Future<void>
Delete the player for a guild.
getInfo() Future<LavalinkInfo>
Get information about the server.
inherited
getPlayer(String guildId) Future<Player>
Get the player for a given guild.
getRoutePlannerStatus() Future<RoutePlannerStatus>
Get the current status of the RoutePlanner extension.
inherited
getStats() Future<LavalinkStats>
Get statistics from the server.
inherited
getVersion() Future<String>
Get the current version of the server.
inherited
listPlayers() Future<List<Player>>
List all players in the current session.
loadTrack(String identifier) Future<LoadResult>
Load one or more tracks from an identifier.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
unmarkAllFailedAddresses() Future<void>
Unmark all failed addresses in the RoutePlanner extension.
inherited
unmarkFailedAddress(String address) Future<void>
Unmark a failed address in the RoutePlanner extension.
inherited
updatePlayer(String guildId, {bool? noReplace, String? encodedTrack = _sentinelString, String? identifier, Duration? position, Duration? endTime = _sentinelDuration, int? volume, bool? isPaused, Filters? filters, VoiceState? voice}) Future<Player>
Create or update a player in a guild.
updateSession({bool? resuming, Duration? timeout}) Future<({bool resuming, Duration timeout})>
Update the current session's properties.

Operators

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

Static Methods

connect(Uri base, {required String password, required String userId, String clientName = defaultClientName}) Future<LavalinkClient>
Create a new client connected to a Lavalink server.

Constants

defaultClientName → const String
The default client name used by this package.
version → const String
The current version of package:lavalink.