Releases: Tomato6966/lavalink-client
v2.10.0
Full Changelog: 2.9.7...v2.10.0
Version 2.10.0
- Now you can directly provide the nodes as classes based on LavalinkNode Class instead of providing options only. This way it will be possible to make custom nodeclasses for yourself.
- This is totaly optional, as it's an extension built on current functionality. you can use the provided NodeLinkNode or LavalinkNode, or just provide the NodeOptions options.
- Added
nodeManager.getNode(...)support for enum/class-based retrieval (NodeType,LavalinkNode,NodeLinkNode), which now resolves to the least-used connected matching node. - Added
nodeManager.leastUsedNodes(sortType, filterForNodeTypes)filtering support to limit results to specific node types/classes before sorting.
e.g. for createNode function
import { NodeLinkNode, LavalinkNode } from "lavalink-client";
// provide NodeLinkNode class:
const nodeLinkClass = new NodeLinkNode({
host: "localhost",
port: 2333,
authorization: "youshallnotpass"
}, client.lavalink.nodeManager);
client.lavalink.nodeManager.createNode(nodeLinkClass); // create+add and bind node to NodeManager
// provide LavalinkNode
const LavalinkNodeClass = new LavalinkNode({
host: "localhost",
port: 2333,
authorization: "youshallnotpass"
}, client.lavalink.nodeManager);
client.lavalink.nodeManager.createNode(LavalinkNodeClass) // create+add and bind node to NodeManager
// example of custom LavalinkNode Class
export class MyCustomLavalinkNode extends LavalinkNode {
constructor(options: LavalinkNodeOptions, manager: NodeManager) {
super(options, manager);
// for custom nodes it doesnt matter which type you use, i suggest to use type Lavalink
this.nodeType = NodeType.Lavalink;
}
public async yourCustomFunction() {
const { response, options } = await this.rawRequest("/customEndpoint", (m) => {
// the path "/customEndpoint" get's automatically changed to "/v4/customEndpoint"
// the default method is "GET"
// the default headers are { Authorization: this.options.authorization }
m.path = ""; // if you want to overwride the pathing like adding the "/v4/" prefix automatically
m.method = "POST";
m.body = safeString({ ...bodyData })
})
if(response.ok) return response.json();
throw new Error(`Failed to yourCustomFunction: ${response.statusText}`);
}
}
const customLavalinkNodeClass = new MyCustomLavalinkNode({
host: "localhost",
id: "customLavalinkClass"
port: 2333,
authorization: "youshallnotpass"
}, client.lavalink.nodeManager);
client.lavalink.nodeManager.createNode(customLavalinkNodeClass) // create+add and bind node to NodeManagerYou can also just straight up provide it as a custom Node in the manager's options in the nodes array:
client.lavalink = new LavalinkManager({
nodes: [
// example of providing just the options, which will create based on nodeType either a LavalinkNode (default) or NodeLinkNode
{
authorization: "youshallnotpass",
host: "localhost",
port: 2333,
id: "Main Node",
},
// example of providing the LavalinkNode
new LavalinkNode({
host: "localhost",
port: 2333,
authorization: "youshallnotpass"
}, client.lavalink.nodeManager),
// example of providing the nodeLink node:
new NodeLinkNode({
host: "localhost",
port: 2333,
authorization: "youshallnotpass"
}, client.lavalink.nodeManager),
// exampekl of provbiding a custom node extending either LavalinkNode or NodeLinkNode.
new MyCustomLavalinkNode({
host: "localhost",
id: "customLavalinkClass"
port: 2333,
authorization: "youshallnotpass"
}, client.lavalink.nodeManager),
]
})Version 2.9.8-2.9.12
parseLavalinkConnUrl(...)was improved:- Supports both
lavalink://andnodelink://connection urls. - Returns
nodeTypefrom the url scheme and now uses theNodeTypeenum. - Added stricter validation (e.g. required value checks) and more usage examples in docs/README.
- Supports both
- Added exported
NodeTypeenum and switched node option typing to use it (LavalinkNodeOptions.nodeType?: NodeType). - NodeLink additions:
- Added
node.getMeaning(...)support withMeaningResponsetypings. - Added gapless next-track helpers via
setNextTrackGapLess(...)andremoveNextTrackGapLess(...). - Fixed NodeLink mixer/stream volume handling (
volume / 100precision handling).
- Added
- Player/Node internal cleanup and behavior fixes:
- Migrated deprecated internal custom-data access from
get/settogetData/setData. player.stopPlaying(...)now clearsnextTrackfor NodeLink as well to avoid stale gapless state.
- Migrated deprecated internal custom-data access from
- Filter fix: compressor default ratio handling was corrected in filter-change detection logic.
Version 2.9.7
- Add
skipTrackSourceoption to player.subscribeLyrics and node.lyrics.subscribe (Ty @EvilG-MC on Github) - Add
player.deleteData()option to delete custom data by key from the custom data field-set of a player. (Ty @MoonCarli on Github)
v2.9.7
FIRST MAJOR RELEASE TO SUPPORT "DAVE"
Check the doc's Version log: https://tomato6966.github.io/lavalink-client/extra/version-log/
What's Changed
- fix: add null check for timescale by @gutseok in #162
- feat(queue): add filtering, sorting, and player reconnect event by @notinsane-dev in #164
- Fix typo: “wether” → “whether” by @MoonCarli in #168
- fix(validation): prevent false positives in link blacklist and whitelist by @MoonCarli in #169
- added nazha on bots used by lavalink-client by @raziscofield in #171
- feat: allow augmentation of Track requester type by @appujet in #170
- fix(ws): sanitize Client-Name header to prevent ERR_INVALID_CHAR by @MoonCarli in #173
- feat: Added Node Health Monitoring by @notinsane-dev in #172
- some fixes by @rly-dev in #174
- Add Arii Music Bot by @Fristonn in #175
- feat: add DAVE support (Lavalink v4 voice channelId handling) by @ductridev in #178
- feat: add skip track source to live lyrics methods by @EvilG-MC in #180
- feat(player): add delete method for custom data keys by @MoonCarli in #179
New Contributors
- @notinsane-dev made their first contribution in #164
- @raziscofield made their first contribution in #171
- @rly-dev made their first contribution in #174
- @Fristonn made their first contribution in #175
Full Changelog: 2.7.4...2.9.7
v2.7.4
Current stable release with a reworked auto node reconnection Queue system.
(fill in the release notes)
What's Changed
- Remove lock file, update gitignore by @Tomato6966 in #58
- Create check.yml by @dawgcodes in #46
- Update check.yml by @appujet in #59
- Git attributes for linguist by @Tomato6966 in #60
- added some filters docs by @appujet in #61
- Update packages and typescript by @hwangsihu in #55
- added new-docs by @appujet in #66
- New docs, cleanup of several files, new build process, no dist anymore by @Tomato6966 in #69
- install normal dependencies during docs too by @Tomato6966 in #70
- Fix build related error which didn't happenlocally by @Tomato6966 in #71
- HTTP enable won't be needed when running dzsearch source. by @dazzypark in #67
- Update Track.ts by @appujet in #68
- Cleanup everything merge and delete by @Tomato6966 in #73
- enforce type by @EvilG-MC in #52
- add new function and event by @PeterGamez in #63
- Linting by @hwangsihu in #74
- Remove Useless Settings by @hwangsihu in #78
- fix: event argument typo by @EvilG-MC in #80
- fix: update player options validation to allow single objects by @EvilG-MC in #83
- Fix: autoPlay not getting called when previousAutoPlay call didn't add any tracks to queue by @PandaIN95 in #85
- Fixed: player.changeNode() by @PandaIN95 in #87
- Fix: tries to reconnect to node when the node is deleted from nodeManager.nodes list by @PandaIN95 in #88
- fix unsubscribe endpoint by @EvilG-MC in #91
- Added "dzrec" source to DefaultSources in #95
- Mini deps update by @PatrykPatryk5 in #93
- fix: autoskip option not working after autoPlayFunction by @dazzypark in #99
- fix url parsing for urls, and have functioning flowerytts handlings by @Tomato6966 in #100
- Add Tidal search support by @notdeltaxd in #105
- fix: correct log by @flav-code in #107
- Fix typing issue by @Kisakay in #108
- Improvements player.changeNode() by @PandaIN95 in #101
- Add source and fix by @LucasB25 in #106
- Remove queue.current on resolveError (fix resolving loop) by @Tomato6966 in #109
- Fix: dont add tracks if the player is already destroying. by @PandaIN95 in #110
- fixed lyrics endpoint by @EvilG-MC in #112
- Update packages, fix types by @LucasB25 in #118
- Add causeStackTrace in TrackExceptionEvent by @lavecat in #116
- fix somes typings + added .DS_Store and bun.lock to gitignore by @Kisakay in #115
- trying to fix deployments in forks by @EvilG-MC in #111
- build: Migrate build to tsup by @appujet in #120
- Added Stelle in README.md by @EvilG-MC in #123
- Update README.md by @appujet in #122
- Update README.md by @LucasB25 in #121
- Add Soundy to Used by by @idMJA in #124
- Update dev dependencies and fix ESLint config by @appujet in #125
- Fixes - changeNode - deleteNode - destroyNode by @PandaIN95 in #131
- Update README.md by @notdeltaxd in #133
- feat: Add automatic player moving on node disconnect by @appujet in #132
- fix: manager options by @EvilG-MC in #136
- fix: pnpm build scripts by @EvilG-MC in #135
- Update lavaSearch.ts by @diwasatreya in #134
- Update README.md by @LucasB25 in #128
- Update lavalink Sample Configuration (application.yaml) by @MoonCarli in #137
- minor fixes in lavalink setup docs by @MoonCarli in #138
- Update lavalink-youtube and add yt-cipher guide by @MoonCarli in #140
- fix: Duplication of key "tidal" in mapping by @MoonCarli in #141
- Added New Pandora Source Support by @ryanwtf88 in #143
- Fix by @LucasB25 in #142
- fix(utils): Allow UnresolvedTrack in isNotBrokenTrack and update docs by @appujet in #147
- packages update and volume by @LucasB25 in #146
- fix: error from typo in play.ts by @KingKonguido in #145
- Update youtube-plugin version and remove unused pandora api, by @ryanwtf88 in #148
- Addition of new bot in Bots Community in README by @sakshamyep in #150
- Update Betty's url at the README.md and added Nero by @fb-sean in #152
- Update README.md by @Kisakay in #151
- Fix by @LucasB25 in #149
- fix: reset paused state on stopPlaying by @darkmxc in #156
- Add BeatDock to used in section by @lazaroagomez in #155
- Update README with add new bot by @PeterGamez in #153
- Fix: player.options.voiceChannelId is not updating after playerMove by @PandaIN95 in #160
- fix by @LucasB25 in #157
- fix: prevent error emission during websocket error handling to allow reconnection attempts by @ductridev in #154
- fix: not reconnecting after 1st error by @ductridev in #161
New Contributors
- @dawgcodes made their first contribution in #46
- @hwangsihu made their first contribution in #55
- @dazzypark made their first contribution in #67
- @PandaIN95 made their first contribution in #85
- @PatrykPatryk5 made their first contribution in #93
- @notdeltaxd made their first contribution in #105
- @flav-code made their first contribution in #107
- @Kisakay made their first contribution in #108
- @LucasB25 made their first contribution in #106
- @lavecat made their first contribution in #116
- @idMJA made their first contribution in #124
- @diwasatreya made their first contribution in #134
- @MoonCarli made their first contribution in #137
- @ryanwtf88 made their first contribution in #143
- @KingKonguido made their first contribution in #145
- @sakshamyep made their first contribution in #150
- @fb-sean made their first contribution in #152
- @darkmxc made their first contribution in https://github.com/Tomato6966/lavalink-client/pull...
2.3.6
All old releases got tagged ( / re-released ) on github from npm.
This is the first proper github release
Please always install from npm if you want to have stable releases.
This is the entire Changelog since the first non-beta release:
Version 1.2.0
- Added
player.stopPlaying(): When executed it clears the Queue and stops playing, without destroying the Player - Adjusted
Player.skip()- Added
throwErrorProperty to:player.skip(skipTo?:number = 0, throwError?:boolean = true).- If throwError = false, and no more tracks are in the queue, it won't throw an error and "ignore it". same thing as stopPlaying.
- Added
- Added all Events and Methods from the SponsorBlock Plugin.
- It also validates if the plugin is in the bot, in order so that you can use the functions:
player.getSponsorBlock()/node.getSponsorBlock()player.setSponsorBlock(segments:SponsorBlockSegment[])/node.setSponsorBlock(segments:SponsorBlockSegment[])player.deleteSponsorBlock()/node.deleteSponsorBlock()- That Plugin adds following Events to the Manager:
"SegmentsLoaded","SegmentSkipped","ChapterStarted","ChaptersLoaded"
- That Plugin adds following Events to the Manager:
- Example Bot show example in autoplayFunction how to "disable" / "enable" Autoplay with bot data variables.
- Added
ManagerOptions#emitNewSongsOnly. If set to true, it won't emit "trackStart" Event, when track.loop is active, or the new current track == the previous (current) track. - Added
ManagerOptions#linksBlacklistwhich allows user to specify an array of regExp / strings to match query strings (for links / words) and if a match happens it doesn't allow the request (blacklist) - Added
ManagerOptions#linksWhitelistwhich allows user to specify an array of regExp / strings to match query strings (for links only) and if a match does NOT HAPPEN it doesn't allow the request (whitelist) - Added
ManagerOptions#linksAllowedif set to false, it does not allow requests which are links - Moved
ManaagerOptions#debugOptionstoManaagerOptions#advancedOptions.debugOptions
Version 1.2.1
- Adjusted
player.stopPlaying()- There are now following parameters.
stopPlaying(clearQueue:boolean = true, executeAutoplay:boolean = false).- On Default it now clears the queue and stops playing. Also it does not execute Autoplay on default. IF you want the function to behave differently, you can use the 2 states for that.
- Fixed that it looped the current track if repeatmode === "track" / "queue". (it stops playing and loop stays)
- There are now following parameters.
- Implemented a
parseLavalinkConnUrl(connectionUrl:string)Util Function.- It allows you to parse Lavalink Connection Data of a Lavalink Connection Url.
Pattern:lavalink://<nodeId>:<nodeAuthorization(Password)>@<NodeHost>:<NodePort> - Note that the nodeId and NodeAuthorization must be encoded via encodeURIComponents before you provide it into the function.
- The function will return the following:
{ id: string, authorization: string, host: string, port: number } - Example:
parseLavalinkConnUrl("lavalink://LavalinkNode_1:strong%23password1@localhost:2345")will give you:
{ id: "LavalinkNode_1", authorization: "strong#password1", host: "localhost", port: 2345 }- Note that the password "strong#password1" when encoded turns into "strong%23password1". For more information check the example bot
- It allows you to parse Lavalink Connection Data of a Lavalink Connection Url.
Version 2.0.0
- Lavalink v4 released, adjusted all features from the stable release, to support it in this client!
# How to load tracks / stop playing has changed for the node.updatePlayer rest endpoint the Client handles it automatically
- await player.node.updatePlayer({ encodedTrack?: Base64|null, track?: Track|UnresolvedTrack, identifer?: string });
+ await player.node.updatePlayer({ track: { encoded?: Base64|null, identifier?: string }, clientTrack?: Track|UnresolvedTrack });
# To satisfy the changes from lavalink updatePlayer endpoint, player play also got adjusted for that (Most users won't need this feature!)
- await player.play({ encodedTrack?: Base64|null, track?: Track|UnresolvedTrack, identifer?: string });
+ await player.play({ track: { encoded?: Base64|null, identifier?: string }, clientTrack?: Track|UnresolvedTrack });
# However it' still recommended to do it like that:
# first add tracks to the queue
+ await player.queue.add(Track: Track|UnresolvedTrack|(Track|UnresolvedTrack)[]);
# then play the next track from the queue
+ await player.play();
# Node Resuming got supported
# First enable it by doing:
+ await player.node.updateSession(true, 360_000);
# then when reconnecting to the node add to the node.createeOptions the sessionId: "" of the previous session
# and after connecting the nodeManager.on("resumed", (node, payload, players) => {}) will be executed, where you can sync the players!
# Node Options got adjusted # It's a property not a method should be treated readonly
+ node.resuming: { enabled: boolean, timeout: number | null };
# Player function got added to stop playing without disconnecting
+ player.stopPlaying(clearQueue:boolean = true, executeAutoplay:boolean = false);
# Node functions for sponsorBlock Plugin (https://github.com/topi314/Sponsorblock-Plugin) got added
+ deleteSponsorBlock(player:Player)
+ setSponsorBlock(player:Player, segments: ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic", "filler"])
# only works if you ever set the sponsor blocks once before
+ getSponsorBlock(player:Player)
# Corresponding nodeManager events got added:
+ nodeManager.on("ChapterStarted");
+ nodeManager.on("ChaptersLoaded");
+ nodeManager.on("SegmentsLoaded");
+ nodeManager.on("SegmentSkipped");
# Filters sending got supported for filters.pluginFilters key from lavalink api: https://lavalink.dev/api/rest.html#plugin-filters
# Native implementation for lavaSearch plugin officially updated https://github.com/topi314/LavaSearch
# Native implementation for lavaSrc plugin officially updated https://github.com/topi314/LavaSrc including floweryTTS
# couple other changes, which aren't noticeable by you.
# Lavalink track.userData got added (basically same feature as my custom pluginInfo.clientData system)
# You only get the track.userData data through playerUpdate objectIn one of the next updates, there will be more queueWatcher options and more custom nodeevents to trace
Most features of this update got tested, but if you encounter any bugs feel free to open an issue!
Version 2.1.0
- Fixed that, if you skip and have trackloop enabled, it doesn't skip the track
- I fixed that in the past, but for some reason i removed the fix on accident ig.
- Reworked the Filter Manager for custom filters via LavalinkFilterPlugin / LavalinkLavaDSPX-Plugin
- Note that the LavalinkLavaDSPX-Plugin is by a Community Member of Lavalink and UNOFFICIAL
- They now have individual state-variabels (booleans):
player.filterManager.filters.lavalinkLavaDspxPluginplayer.filterManager.filters.lavalinkLavaDspxPlugin.echoplayer.filterManager.filters.lavalinkLavaDspxPlugin.normalizationplayer.filterManager.filters.lavalinkLavaDspxPlugin.highPassplayer.filterManager.filters.lavalinkLavaDspxPlugin.lowPass
- and for:
player.filterManager.filters.lavalinkFilterPlugin(this plugins seems to not work on v4 at the moment)player.filterManager.filters.lavalinkLavaDspxPlugin.echoplayer.filterManager.filters.lavalinkLavaDspxPlugin.reverb
- They also now have individual state-changing-methods:
player.filterManager.lavalinkLavaDspxPluginplayer.filterManager.lavalinkLavaDspxPlugin.toggleEcho(decay:number, echoLength:number)player.filterManager.lavalinkLavaDspxPlugin.toggleNormalization(maxAmplitude:number, adaptive:boolean)player.filterManager.lavalinkLavaDspxPlugin.toggleHighPass(boostFactor:number, cutoffFrequency:number)player.filterManager.lavalinkLavaDspxPlugin.toggleLowPass(boostFactor:number, cutoffFrequency:number)
- and for:
player.filterManager.lavalinkFilterPluginplayer.filterManager.lavalinkFilterPlugin.toggleEcho(delay:number, decay:number)player.filterManager.lavalinkFilterPlugin.toggleReverb(delays:number[], gains:number[])
- They now have individual state-variabels (booleans):
Version 2.1.1
- Enforce link searches for users with following searchPlatform Options: "http" | "https" | "link" | "uri"
- Additionally strongend the code behind that
- Added searchPlatform for local tracks (aka files on the lavalink server...): "local"
Version 2.2.0
- Changed console.error to throw error on queue.utils.sync if no data was provided/found
- Changed undici.fetch to native fetch, but requires nodejs v18+ to support other runtimes, e.g. bun
- Added sourceNames for
bandcamp(from native lavalink) if it's supported it will use lavalink'S search, else the client search on player.search({ source: "bandcamp" }) (you can also use bcsearch or bc) - Added sourceName for
phsearchfrom the dunktebot plugin, released in v.1.7.0 - Support for youtube still going via the youtube-source plugin (disable youtube for lavalink, and use the plugin instead)
- Exporting events
- Added new debugOption: logCustomSearches
- (Next version update i will remove the internal interval for position update, to calculations)
Version 2.2.1
- Player position is now calculated instead of using intervals
- Instaplayer fix update now requires quite good internet connection on the lavalink server due to removal of intervals for updating player.position (everything above 300mbps should be good)
- Internal updates for handling query params and url-requests (url-parsing) to...
Release 2.3.5
Automatically published from NPM
Release 2.3.4
Automatically published from NPM
Release 2.3.3
Automatically published from NPM
Release 2.3.2
Automatically published from NPM
Release 2.3.1
Automatically published from NPM
Release 2.3.0
Automatically published from NPM