Skip to content

Releases: lavalibs/lavalink.js

v2.2.1

28 Sep 17:16

Choose a tag to compare

Fixes

  • BaseCluster's Class name should be BaseCluster and not Cluster
  • BaseCluster#filter should be a method and not a property

v2.2.0

28 Sep 04:18

Choose a tag to compare

Additions

  • License file
  • Base clusters and nodes; abstract classes that can be extended in other libraries
    • Corresponding options typedefs
  • NodeOptions and ClusterNodeOptions are 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

22 Aug 15:55

Choose a tag to compare

Fixes

The last minor update broke Node#load for songs which had special characters in the url (%, $, & for example) this update revert the hotfix and note in the Readme that the lib doesn't uri encode queries (43819a7)

v2.1.0

21 Aug 20:41
9e8e84d

Choose a tag to compare

Additions

  • HTTPError constructor now take a method and url parameter, HTTPError#path and HTTPError#method added (18d9e52)

Fixes

  • HTTPError#message will now properly show the acording Error Message and not only the Error Code (18d9e52)

  • Node#load will now properly uri encode the input (037f3fd)

v2.0.0

14 Aug 03:56
139d6bd

Choose a tag to compare

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 HTTPError class when thrown (04dc145, a4eca58)
  • Client has been renamed to Node (3d74e55, a4eca58)
  • Connections will exponentially backoff when auto-reconnecting (65760db)

Additions

  • Clustering! See readme for details (5ddc00b, 5c51ee5, d7bc2ab, 6ca7f47)
  • Nodes now accept the send method as a constructor option instead of requiring extension/prototype modification (6ca7f47)
  • Players now have a moveTo method to allow movement to a new node (d7bc2ab)
  • Players now have voiceState (partial) and voiceServer properties to fetch the most recently received voice packets for that player (d7bc2ab)

Fixes

  • Players will now be properly GC'd when destroyed (d7bc2ab)
  • Connections will no longer attempt to reconnect when an error is received and the connection is still open (65760db)

v1.1.1

28 Jul 20:37

Choose a tag to compare

Fixes

v1.1.0

25 Jul 22:43

Choose a tag to compare

Additions

  • Player#play now also accepts a track object (5b9d901)
  • ClientOptions includes a nullable shardCount property to provide a shard count when constructing a client. Additionally, Client now has a shardCount property that is passed to the Lavalink node in the initial connection handshake (844c519)

v1.0.0

25 Jul 22:38

Choose a tag to compare

Initial stable release. Supports Lavalink v3.

API description

Player

  • readonly client: Client
  • guildID: string
  • status: Status
  • play(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: PlayerStore
  • load(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?: Connection
  • http?: Http
  • password: string
  • userID: 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;
  };
}