91 Replies
Since Lavalink v4 is right around the corner I should probably start brainstorming some ideas for the new api
*Since Lavalink V4 is here I should ...
Nodes & Clusters
A
Node
is a connection to a single lavalink instance while a Cluster
is a collection of Node
s, both Cluster
& Node
implement a shared interface
named Client
which is the public facing api.
Note:
Instead of uri: string, options: ...
you can just pass in a single object like in lavaclient
v4.
Manage Players
Note:
Similar to discord.js managers you can just access the underlying cache map via <Client>.players.cache
Player Usage
Other
Discord Libraries
Since lavaclient will be remaining as a discord-library agnostic library I will be creating some connector libraries for a quicker, more streamlined experience when using libraries like discord.js.
Runtimes
All of these changes will be brought to the deno client when lavaclient v5 drops
@asszx @zapteryx @justapie06 @tijmenh. @ivioleti
Sorry for the pings! Since all of you have created threads in this channel & remained in the server I wouldn't mind some feedback on this if you're still using my client :3
I will be mentioning the @lavaclient user from here on out so if you want more updates please use <id:customize> to give yourself the roleheya
i have no objections to any of the changes but i assume there'll be a more thorough document or readme indicating breaking changes between v4 and v5?
more than likely
if yes then im fine with it 👍
looking forward to it as well
Pinning this in here since it's apart of the v5 changes:
https://www.npmjs.com/package/lavalink-protocol
https://www.npmjs.com/package/lavalink-ws-client
https://www.npmjs.com/package/lavalink-api-client
npm
lavalink-protocol
Type-safe validation for the Lavalink protocol.. Latest version: 1.0.0-rc.4, last published: 2 hours ago. Start using lavalink-protocol in your project by running
npm i lavalink-protocol
. There are 2 other projects in the npm registry using lavalink-protocol.npm
lavalink-ws-client
Type-safe WebSocket client for Lavalink. Latest version: 1.0.0-rc.1, last published: 2 hours ago. Start using lavalink-ws-client in your project by running
npm i lavalink-ws-client
. There are no other projects in the npm registry using lavalink-ws-client.npm
lavalink-api-client
Type-safe API client for Lavalink. Latest version: 1.0.0-rc.5, last published: 2 hours ago. Start using lavalink-api-client in your project by running
npm i lavalink-api-client
. There is 1 other project in the npm registry using lavalink-api-client.@dastormer not sure if you still use lavaclient for StormBeatz but pinging you just in case
and if you don't maybe some of those new packages will interest you once they're finished
@lavaclient user
Published the first alpha version since it works™️. However, some stuff hasn't been implemented yet since i'm tired asf
1. clustering
2. most node events
API
This is basically what will be released in v5. If you have any objections please send a constructive message :D
Refer to types & this message for api usage: https://canary.discord.com/channels/323365823572082690/1137317796821336085/1137321192626335754
Installation
https://www.npmjs.com/package/lavaclient/v/5.0.0-alpha.1
pnpm/npm install lavaclient@alpha
yarn add lavaclient@alpha
yep, still using lavaclient, thanks for the update i'll check it out soon
@lavaclient user
Plugin Updates
2 new plugins are being added to the family (but i have yet to publish them)
Simplified Filter Management
Allows for easier filter management through "effects"
1. This will apply 'nightcore' and any previously toggled effects.
2. Since 'nightcore' and 'slowed' both use the
timescale
filter the plugin will automatically disable 'nightcore' and keep 'slowed'
Better LavaSearch Integration
Better API client integration with the LavaSearch plugin by Topi
1. Loads a LavaSearch
result with tracks, artists, and albums. Throws an exception if nothing was found.
2. Does the same thing as 1 but returns null
if nothing was found.
Misc.
- The queue plugin is also getting a rework.
- If Topi finishes the LavaQueue lavalink plugin I may write an integration plugin
Other Updates
- Clustering has been implemented
- LavalinkAPIClient
has been renamed to LavalinkHTTPClient
👍 lgtm
Oh, a sponsorblock integration plugin is also something I have planned for the websocket client
https://www.npmjs.com/package/lavaclient/v/5.0.0-alpha.2
https://www.npmjs.com/package/lavalink-protocol/v/1.0.0-rc.6
https://www.npmjs.com/package/lavalink-ws-client/v/1.0.0-rc.3
https://www.npmjs.com/package/lavalink-api-client/v/1.0.0-rc.8
https://www.npmjs.com/package/@lavaclient/plugin-lavasearch/v/1.0.0-rc.1
https://www.npmjs.com/package/@lavaclient/plugin-effects/v/1.0.0-rc.1
everything has been published!
There's a testing package in the mono-repo you can look at for an example how the clustering looks
@lavaclient user https://www.npmjs.com/package/lavaclient/v/5.0.0-rc.1
lavalink-protocol & lavalink-api/ws-client all have 1.0 releases now, plugins are still a wip
npm
lavaclient
A simple, easy-to-use, and flexible lavalink client for node.js. Latest version: 4.1.1, last published: 2 years ago. Start using lavaclient in your project by running
npm i lavaclient
. There are no other projects in the npm registry using lavaclient.all of those errors are now fixed, now I just need to fix my play cmd as everythings broken :SadCat2:
oh and I want to add cluster-wide config for stuff like ws & api options
@lavaclient user active v5 users i want to know if you've had any problems migrating or experienced any bugs/issues with the new api
oh yeah react with the emoji if you read this message btw
@gino i assume there's no way to use lavaclient v5 in conjunction with the queue plugin at this moment?
no but i can port it real quick
ah that'd be great, i've finished migrating to lavaclient v5 but the only thing stopping it from working is the queue LOL
lavaclient & lavalink-protocol will get two new versions along side this port
@lavaclient user released updates to some packages
[email protected]
switched from typed-emitter
to tiny-typed-emitter
so that plugins could add events
[email protected]
added mayStartNext
objectsick
and for those who use the queue plugin, an almost compatible port is available at
@lavaclient/plugin-queue
the 1.0 will use the new userData
track field and have some general improvements👌 tysm
you guys have it easy with pre made queue plugins, I had to make my own bad queue system
it's not even that good tbh
probably better than mine
@gino oh yeah is the spotify plugin gonna be made compatible too?
no
use lavasrc
👍
i might make a plugin like lavasrc for client side stuff if people don’t know java
but it won’t have anything built in
i've managed to get everything ported over, looks good so far but i'm just getting ERR_MODULE_NOT_FOUND for
import '@lavaclient/plugin-queue/register';
now:hmm:
are you using esm?
yup
that may be why
i don't have esm exports
ah i see
:ImDead:
erm
you can try to load it manually, there's a load export
gotcha
lemme give that a shot
aight thanks man i think it worked but just some issues with my code now
why can't i delete that
💀
discord moment
Did you solve this error?
.
yea i did, idk whats up with my code now but the queue refuses to start
hm
ah wth
ty for that LOL i was still using Node#createPlayer which was able to create the player but queue refused to start
switching to PlayerManager#create fixed it
createplayer should be private ?
well
its marked as internal
hmmmm maybe i should make it clearer that
hmm im not sure, ts wasn't saying anything and it was still working
but ty! works fine now
i've ported to v5
well its public for people who want to change what player class is used but its only meant for internal use
ah i see
iydmma, are you porting quaver?
sorry i missed your message, yep
i've been busy the past few months but i have some free time at the moment and youtube was constantly throwing errors for the last lavalink version
so i upgraded lavalink and ported to lavaclient v5
https://github.com/ZPTXDev/Quaver/blob/master/src/lib/PlayerHandler.ts#L270-L273
lmao
i should improve the effects api
it's basically a port of @Keia Development's effect management stuff and I haven't had to explicitly "set" an effect's state
LMFAO i was writing bandaid solutions at that point i just wanted to get everything working cuz quaver was non-functional for like 2 or 3 days at that point
ahh i see, makes sense
:mmlol: https://img.2d.gay/c9aa5b45.png
wait
i do allow explicitly
oops
ahahahaah that's funny
ok
LOL
i have no excuses then
ahem
it's alright i mean as long as it gets the job done
i was planning to rewrite quaver for some time actually but never found the time for it
this is why everything is a release candidate rn
mhm mhm makes sense
the client itself seems fine though
yup, so far no issues whatsoever
i think it's all good
i like the better defined properties in v5
everything makes more sense
that was the goal :Tired:
the new packages help a lot too, i spent quite a bit of time on the lavalink api, ws, and protocol packages
everything is type-safe and validated at runtime
i think the effort paid off, everything just works™️
now you just gotta fix the site
yeah LOL i got an issue with that
it's not really a code issue but rather cert issue
also turns out i forgot to load the effects plugin in my port
whoops
fixed it and nightcore works but seems like bassboost isn't working
makes sense
hm
there are only 14 bands
GitHub
Quaver/src/lib/PlayerHandler.ts at master · ZPTXDev/Quaver
Simple-to-use music bot with features such as bass boost, nightcore, seek, search, and more. - ZPTXDev/Quaver
should be length: 9
:SmileyCat:
runtime validation at work
ah ty LOL
your logger could use some work i think
the validation error is the error cause but it doesn't seem to have been rendered
yeah i'll rework it in my rewrite
as for this it's just that i'm using letsencrypt's certs and they renew every 3 months or so, i needa symlink the cert to quaver's container but that's not quite possible (at least from what i've tried) so yeah it's quite a pain
im also sure there's way better ways for me to do what im doing but i have not had time to figure any of that out unfortunately
yeah fair
that's why i use a reverse proxy that does it for me
traefik my beloved
i'll have to look into that sometime
length 9 still didn't fix it tho hm
strange
you build ?
yep the js shows 9 too
my bad there are 15 bands
14 is the highest index :Lols:
oh LOL hmm
ah.
yep that fixed it, thanks!
not the first time i've messed that up 😔
:Nice:
@lavaclient/plugin-lavasearch has esm support but I can't use the loadSearch function : interactionRun: guild.client.music.api.loadSearch is not a function
have you loaded it?
- https://github.com/lavaclient/lavaclient/blob/feat/v5/packages/test/src/index.ts#L4
- or calling https://github.com/lavaclient/lavaclient/blob/feat/v5/packages/plugin/lavasearch/src/plugin.ts#L7
also fyi create posts instead of speaking in this channel
Yes, I loaded it, but I cannot access the function.
one sec
create a post
lavaclient - v5.0.0-rc.3
Documentation for lavaclient
@gino hey is there a migration guide or smthn for v5
not really but check the pins of this thread
or the read me