DF
Dimensional FunJackW25
Some Problems Migrating to v5
Hey all, sorry this is probably a very stupid post, I haven’t touched this in over a year and I learned about Lavalink v4 and Lavaclient v5 being released
After getting errors with searches returning 400 errors and whatnot, I decided to migrate my discord bot from Lavalink v3 and Lavaclient v4.
I’ve come into many problems with this migration but I had a few I wasn’t sure about and I didn’t find any documentation for migrating.
From what I can tell, @lavaclient/queue, @lavaclient/types, and @lavaclient/spotify are all deprecated and don’t work anymore?
Are there any alternatives yet for these I can begin to implement into Lavaclient? My main errors now lie with these packages no longer working
I don’t have much Java experience as someone mentioned Lavalink plug-ins to me, but I’d be terrible at those
I was also told possibly about LavaSrc, but I’m not sure how I’d go at implementing that client side too.
Again thank you! Sorry if this seems like a horribly stupid question, it’s been a while since I’ve touched JS
V
viztea•30d ago
hi
From what I can tell, @lavaclient/queue, @lavaclient/types, [...] are all deprecated and don’t work anymore?The queue plugin is being rewritten since it kinda sucks, there's a port at
@lavaclient/plugin-queue
types has been rewritten to support runtime validation at lavalink-protocol
and @lavaclient/spotify...As you've already mentioned, LavaSrc exists. I still believe client-side fetching is better all around but LavaSrc will be faster.
but I’m not sure how I’d go at implementing that client side too.You just call the load tracks endpoint like any other query
J
JackW25•29d ago
Ah okay thank you! So (again sorry for my stupidity), besides these changes there isn’t really any other major or breaking changes I should have to worry about, besides just updating to accommodate for these?
V
viztea•29d ago
depends on what you mean
v5 is an entire rewrite
check the pinned messages in the project discussion thread
J
JackW25•28d ago
I've been fairly busy lately, in a new career and all over the place but I recently took over this project from a friend. It's been a while since I've touched lavaclient or much NodeJS for that matter, so I'm getting stuck quite easily haha. Sorry for my ignorance
I checked out the pinned thread which seems like most the information I'll need once I figure out how to talk with Lavalink now.
So most of what I'm needing to figure out is how to update the rest of my code, how to find existing players, create a player, pass track data, etc. etc.
One of the issues I've had troubles with specifically is dealing with players. Especially in regards to starting a queue and whatnot. Simply doing:
Won't work, so I'm having some difficulties trying to figure out the new system for players, queue, etc.
V
viztea•28d ago
player.queue.start starts the queue
J
JackW25•28d ago
Ah okay thank you, so there shouldn’t be much difference with controlling the players and queue?
V
viztea•28d ago
no not really
J
JackW25•28d ago
Alright that should help thank you! This is all quite new for me again as the last time I worked with lavaclient must’ve been over a year ago.
By change is there any form of docs or whatnot for the player, queue, etc., I can refer to? Just getting caught on little things like
players.get(GuildId)
and whatnot.
Thank you again!V
viztea•28d ago
check the latest message in the pinned thread
V
viztea•28d ago
TS Docs | Reference docs for npm packages
Generate type documentation for npm libraries
J
JackW25•27d ago
Ah thank you very much I’ll take a look at these! Sorry again for my ignorance when it comes to this all
V
viztea•27d ago
it’s fine
J
JackW25•27d ago
Yeah I'm having tons of issues when trying to start queue and player and whatnot. Player will join the voice channel but stop there; not actually play the track. trackStart isn't at all being triggered, etc.
Esp having difficulties with things like:
Which should in theory be a pretty easy task, just loading an array
tracks
populated with const track = results.data[0];
, etc.
Just given the serious issues I have with the time to do this, I'll probably have to find a new client or wait until there's more docs on this, I'm having trouble with all these simple functions even mentioned in those docs. Hopefully coming back to this in a bit should make it easier if either more is available on it or I can get the time to figure this out on my ownV
viztea•27d ago
I can't really do much without your code tbh
https://github.com/lavaclient/lavaclient/tree/master/packages/test
take a look at that, it's more of a testing playground than an example though
although I haven't updated it yet, the djs v13 example may be helpful since it gives you an idea on how you should use the queue
also W apple music user
Could you send your lavalink logs too
it may be more simple than something like misusing the library
should've started at that tbf 🙃
J
JackW25•27d ago
Ah thank you I'll take a look at those
As for my code, I'm happy to provide it, so far just working at the basics before adding in everything:
Lavalink Logs Show:
It's very likely I missed something, I'm not very thorough with these so I'd suspect its user error haha, also appreciate the Apple Music its great haha
V
viztea•27d ago
had to backtrack. these logs don't show the full process of connecting, loading track, creating a player, and updating it
J
JackW25•27d ago
This same bot account has been used with Lavalink v3 and Lavaclient v4 for a while before this, only thing that triggered the update was Lavaplayer giving 400 errors when returning search results from YouTube, so I figured the best fix would be upgrading
V
viztea•27d ago
did you disconnect after running the play command and stuff
ahahahahaha
i see
i should really fix this LMFAO
lavaclient#createPlayer is an internal method, it should only be overridden from the user, not called.
use lavaclient#players#create instead
J
JackW25•27d ago
Took a SC of the Lavalink logs, might show a bit more here haha
J
JackW25•27d ago
ah I'll try out that might be the issue
V
viztea•27d ago
createPlayer is just
new Player(guildId, this)
it doesn't register the playerJ
JackW25•27d ago
Ah I see, replacing that line with
V
viztea•27d ago
yup
J
JackW25•27d ago
still seems to not want to play anything through voice, lavalink logs are all showing similar as to what they were before:
Although from before, it seems loading anything player.queue was undefined, like
player.queue.start
or player.queue.on
, so I probably had an issue with how queue was defined from there, that was causing the immediate disconnect haha
Thank you again for all this help I'm a total idiot when it comes to this stuff LMAOV
viztea•27d ago
you need
require("@lavaclient/plugin-queue/register"
) at the top of your index.js
I'm not helping much either tbhJ
JackW25•27d ago
Ah I see, got the queue stuff working thank you! Despite doing that although and trying:
It still does not play the track,
trackStart
also doesn't seem to trigger
Knowing me, prob my bad code hahaV
viztea•27d ago
lavalink logs
V
viztea•27d ago
should use this code too https://github.com/lavaclient/lavaclient/blob/master/packages/test/src/index.ts#L81-L106
GitHub
lavaclient/packages/test/src/index.ts at master · lavaclient/lavacl...
A simple, easy-to-use, and flexible lavalink client for node.js - lavaclient/lavaclient
V
viztea•27d ago
J
JackW25•27d ago
lavalink:
ah thank you I'll add that rn
Put that in but still doesn't seem to change any of the logs
V
viztea•27d ago
it's not supposed to, i just want to see the results
J
JackW25•27d ago
Ah I see my bad. Testing it and nothing seems different at least in terms of behaviour, etc.
V
viztea•27d ago
btw player.queue doesn't have a track start event
player does
nvm im a fucking liar LMFAO
wtf is your issue lmfao
J
JackW25•27d ago
I'm honestly not sure lmao
Right now player seems to connect and track data loads fine, but the bot wont play anything, just sits in call
V
viztea•27d ago
it's because your code isn't submitting voice updates
show me your bot logs
J
JackW25•27d ago
Bot logs are here, kinda went nuts earlier and logged all the track data to see if there was any issue there so its a bit overkill LMAO
V
viztea•27d ago
you didn't add this ?
V
viztea•27d ago
V
viztea•27d ago
remove
: unknown[]
J
JackW25•27d ago
Ah I had added that but left some of the type annotation in, thats my bad
These are the current logs:
Had to cut off the one ws event log just cause it was too long for this message but I can send a txt or a paste of it if needed
V
viztea•27d ago
track exception event :mm:
try this jar https://repo.lavalink.dev/artifacts/lavalink/fe62703c/Lavalink.jar
J
JackW25•27d ago
Ah that worked for getting the Exception out the way, but still wont play anything in the call
Trying again I get these logs
Also just realizing the time now, it's near midnight over here so I'll likely have to look at this tomorrow with fresh eyes haha. Have work super early in the morning which sucks but I'll definitely take another look at these tomorrow. Thank you again for all the help I do appreciate it
V
viztea•27d ago
and there are no bot logs like
"updating voice status in guild"
"submitting voice update to node."
?
Sounds good. Sorry for the relentless back & forth, I don't think it's to do with the library but I don't know for sure lol
J
JackW25•27d ago
There is this I found just from a quick search of the logs
Nothing else although
V
viztea•27d ago
I'll push an update for more voice status debug logging
J
JackW25•27d ago
You're all good haha I apologize for my ignorance with these things, you're helping a ton, I'd be completely lost on my own lmao
Its interesting being back with NodeJS, I started using it years ago, now out of high school and working sometimes 50 hours a week I stopped using it entirely but it's good to be back working with it, just forgot all of it haha
V
viztea•27d ago
unfortunately i'm jobless so I have too much time to dedicate to my projects :')
J
JackW25•27d ago
Ah haha I’d love that so much more. Just in the process of becoming a full time paramedic so I’m having to work a lot more than I like lmao
Nothing wrong with too much time haha
E
Elon•26d ago
wrong server mb
hey @gino sorry for ping but u available?
V
viztea•25d ago
don’t ask to ask
also create a new thread
129Members
View on DiscordWant results from more Discord servers?
More PostsLavalinkHTTPError: Unable to validate JSON response```LavalinkHTTPError: Unable to validate JSON response
at C:\Users\hamit\OneDrive\Belgeler\GitHuloadSearch is not a function@lavaclient/plugin-lavasearch has esm support but I can't use the loadSearch function : interactionRError: TypeError [ERR_HTTP_INVALID_HEADER_VALUE]Hello, I encountered this error while migrating to the new version of lavaclient. ```TypeError [ERR_Error: Unexpected server response: 200When using lavaclient via deno's npm support (I was using lavadeno but that isn't updated to lavalinplay localfile using lavaclientI want to ask that is it possible to play localfile using lavaclient (since my bot already integrateSearch Exception: Unknown file format.Im using "@lavaclient/spotify" and using this as configuration
```javascript
client: {
id: proHaving an issue with my own Pterodactyl Egg but don't know a fixIm using my own lavalink server and when i try making a request is empty and 404 trying to do myip:2Play music from other sourceshello
I would like to know if there is a way to play music from other sources that are not in the lReferenceError: sendWithDiscordLib is not definedI am getting this error:
```Uncaught Promise Rejection ReferenceError: sendWithDiscordLib is not defTrying to make a commandcan someone tell me how to make a simple autoplay command using lavaclient?Project DiscussionA thread for discussing #lavaclient & related stufffError: 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()?