Releases: lavalibs/lavalink.js
Releases · lavalibs/lavalink.js
v2.2.1
v2.2.0
Additions
- License file
- Base clusters and nodes; abstract classes that can be extended in other libraries
- Corresponding options typedefs
NodeOptionsandClusterNodeOptionsare now exported
Fixes
ClusterNodes now only emit on themselves if they have a listener for that event- HTTP requests will no longer cause unhandled errors if the Lavalink server responds with unexpected data
v2.1.1
v2.1.0
v2.0.0
Breaking changes
- Attempts to send a packet over the WebSocket will now queue the request instead of throwing an error (65760db)
- HTTP errors are now properly encapsulated in an
HTTPErrorclass when thrown (04dc145, a4eca58) Clienthas been renamed toNode(3d74e55, a4eca58)- Connections will exponentially backoff when auto-reconnecting (65760db)
Additions
- Clustering! See readme for details (5ddc00b, 5c51ee5, d7bc2ab, 6ca7f47)
- Nodes now accept the
sendmethod as a constructor option instead of requiring extension/prototype modification (6ca7f47) - Players now have a
moveTomethod to allow movement to a new node (d7bc2ab) - Players now have
voiceState(partial) andvoiceServerproperties to fetch the most recently received voice packets for that player (d7bc2ab)
Fixes
v1.1.1
v1.1.0
Additions
v1.0.0
Initial stable release. Supports Lavalink v3.
API description
Player
- readonly
client: Client guildID: stringstatus: Statusplay(track: string, { start?: number, end?: number } = {}): Promise<void>setVolume(volume: number): Promise<void>seek(position: number): Promise<void>pause(paused = true): Promise<void>stop(): Promise<void>destroy(): Promise<void>join(channel: string, { deaf = false, mute = false } = {}): Promise<void>
enum Status {
INSTANTIATED,
PLAYING,
PAUSED,
ENDED,
ERRORED,
STUCK
}Client
- abstract
send(guildID: string, pk: any): Promise<void> constructor(options: ClientOptions)players: PlayerStoreload(identifier: string): Promise<TrackResponse[]>decode(track: string | string[]): Promise<TrackResponse | TrackResponse[]>voiceStateUpdate(packet: VoiceStateUpdate): Promise<boolean>voiceServerUpdate(packet: VoiceServerUpdate): Promise<boolean>voiceStates: Map<string, string>voiceServers: Map<string, VoiceServerUpdate>connection?: Connectionhttp?: Httppassword: stringuserID: string
interface ClientOptions {
password: string;
userID: string;
shardCount?: number;
hosts?: {
rest?: string;
ws?: string | { url: string, options: WebSocket.ClientOptions };
};
}
interface TrackResponse {
loadType: LoadType,
playlistInfo: PlaylistInfo,
tracks: Track[]
}
interface TrackResponse {
loadType: LoadType,
playlistInfo: PlaylistInfo,
tracks: Track[]
}
interface PlaylistInfo {
name?: string,
selectedTrack?: number
}
interface Track {
track: string;
info: {
identifier: string;
isSeekable: boolean;
author: string;
length: number;
isStream: boolean;
position: number;
title: string;
uri: string;
};
}