V
viztea•272d ago
Since Lavalink v4 is right around the corner I should probably start brainstorming some ideas for the new api
T
topi•272d ago
*Since Lavalink V4 is here I should ...
V
viztea•272d ago
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 roleM
max•272d ago
heya
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?
V
viztea•272d ago
more than likely
M
max•272d ago
if yes then im fine with it 👍
looking forward to it as well
V
viztea•272d ago
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.V
viztea•257d ago
@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
D
DaStormer•250d ago
yep, still using lavaclient, thanks for the update i'll check it out soon
V
viztea•240d ago
@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
M
max•240d ago
👍 lgtm
V
viztea•240d ago
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
V
viztea•70d ago
@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.B
Bloxs•70d ago
all of those errors are now fixed, now I just need to fix my play cmd as everythings broken :SadCat2:
V
viztea•54d ago
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
M
max•52d ago
@gino i assume there's no way to use lavaclient v5 in conjunction with the queue plugin at this moment?
V
viztea•52d ago
no but i can port it real quick
M
max•52d ago
ah that'd be great, i've finished migrating to lavaclient v5 but the only thing stopping it from working is the queue LOL
V
viztea•52d ago
lavaclient & lavalink-protocol will get two new versions along side this port
@lavaclient user released updates to some packages
lavaclient@5.0.0-rc.2
switched from typed-emitter
to tiny-typed-emitter
so that plugins could add events
lavalink-protocol@1.0.1
added mayStartNext
objectM
max•52d ago
sick
V
viztea•52d ago
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 improvementsM
max•52d ago
👌 tysm
B
Bloxs•52d ago
you guys have it easy with pre made queue plugins, I had to make my own bad queue system
V
viztea•52d ago
it's not even that good tbh
B
Bloxs•52d ago
probably better than mine
M
max•52d ago
@gino oh yeah is the spotify plugin gonna be made compatible too?
V
viztea•52d ago
no
use lavasrc
M
max•52d ago
👍
V
viztea•52d ago
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
M
max•52d ago
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';
nowV
viztea•52d ago
:hmm:
are you using esm?
M
max•52d ago
yup
V
viztea•52d ago
that may be why
i don't have esm exports
M
max•52d ago
ah i see
V
viztea•52d ago
:ImDead:
erm
you can try to load it manually, there's a load export
M
max•52d ago
gotcha
lemme give that a shot
aight thanks man i think it worked but just some issues with my code now
V
viztea•52d ago
why can't i delete that
💀
discord moment
R
redbuls81.py•51d ago
Did you solve this error?
V
viztea•51d ago
.
M
max•51d ago
yea i did, idk whats up with my code now but the queue refuses to start
hm
V
viztea•51d ago
M
max•51d ago
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
V
viztea•51d ago
createplayer should be private ?
well
its marked as internal
hmmmm maybe i should make it clearer that
M
max•51d ago
hmm im not sure, ts wasn't saying anything and it was still working
but ty! works fine now
i've ported to v5
V
viztea•51d ago
well its public for people who want to change what player class is used but its only meant for internal use
M
max•51d ago
ah i see
V
viztea•51d ago
iydmma, are you porting quaver?
M
max•50d ago
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
V
viztea•50d ago
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
M
max•50d ago
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
V
viztea•50d ago
:mmlol: https://img.2d.gay/c9aa5b45.png
V
viztea•50d ago
wait
i do allow explicitly
oops
ahahahaah that's funny
ok
M
max•50d ago
LOL
V
viztea•50d ago
i have no excuses then
M
max•50d ago
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
V
viztea•50d ago
this is why everything is a release candidate rn
M
max•50d ago
mhm mhm makes sense
V
viztea•50d ago
the client itself seems fine though
M
max•50d ago
yup, so far no issues whatsoever
i think it's all good
i like the better defined properties in v5
everything makes more sense
V
viztea•50d ago
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
M
max•50d ago
i think the effort paid off, everything just works™️
V
viztea•50d ago
now you just gotta fix the site
M
max•50d ago
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
V
viztea•50d ago
makes sense
M
max•50d ago
hm
V
viztea•50d ago
there are only 14 bands
V
viztea•50d ago
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
V
viztea•50d ago
should be length: 9
:SmileyCat:
runtime validation at work
M
max•50d ago
ah ty LOL
V
viztea•50d ago
your logger could use some work i think
the validation error is the error cause but it doesn't seem to have been rendered
M
max•50d ago
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
V
viztea•50d ago
yeah fair
that's why i use a reverse proxy that does it for me
traefik my beloved
M
max•50d ago
i'll have to look into that sometime
length 9 still didn't fix it tho hm
strange
V
viztea•50d ago
you build ?
M
max•50d ago
yep the js shows 9 too
V
viztea•50d ago
my bad there are 15 bands
14 is the highest index :Lols:
V
viztea•50d ago
M
max•50d ago
oh LOL hmm
V
viztea•50d ago
V
viztea•50d ago
M
max•50d ago
ah.
V
viztea•50d ago
M
max•50d ago
yep that fixed it, thanks!
not the first time i've messed that up 😔
V
viztea•50d ago
:Nice:
R
redbuls81.py•49d ago
@lavaclient/plugin-lavasearch has esm support but I can't use the loadSearch function : interactionRun: guild.client.music.api.loadSearch is not a function
V
viztea•49d ago
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
R
redbuls81.py•49d ago
Yes, I loaded it, but I cannot access the function.
V
viztea•49d ago
one sec
create a post
V
viztea•32d ago
lavaclient - v5.0.0-rc.3
Documentation for lavaclient
129Members
View on DiscordWant results from more Discord servers?
More PostsError: Unexpected server response: 404Hey I have downloaded the newest java to be able to use lavasrc but since then lavaclient isn't workNodesHello. Iam new in lavaclient and I propably dont really undersnatd one of important parts of the libnodeTrackStart and nodeQueueFinish is not assignable to parameter of type 'keyof ClusterEvents'.Hello. Iam developing discord music bot and I have problem with handler.the bot keeps disconnecting while playingif I play a song after a while it get skipped or the bot disconnect in the middle of the song, even can you set the volume by default.when you create player for the first time using /play command for example is there's anyway to set tDiscussion ThreadsHello!Project DiscussionA thread for discussing KyuTranslationsForum discussing Kyu TranslationsDifference between pause(false) and resume()What's the difference between pause(false) and resume()?Any way to reconnect when node restartsI'm currently using the reconnect: { basic: whatever } property in my nodes. While this works whenevtrackEnd event isn't fired after bot is dc'd and rejoinsFor some reason the trackEnd event isn't fired in lavadeno if the bot was manually disconnected (by