(Bug): Error synchronizing information when connection is resumed
This error pops up even though the player is playing music.
after this i do some other checks and then
and it throws the error right here.
If it was my problem the first check should've stopped me from setting the volume but the
player
and player.current
are setSolution:Jump to solution
Thanks for the explanation, I'll fix it as soon as I finish all the changes I'm making
94 Replies
To reproduce you play some song, then you CTRL+C the bot, restart it and then play another song and change the volume.
config:
In the code you are putting if player or player current has nothing it will return what is in the embed
The right thing to do would be to use the player.playing property
yeah but that doesn't change the fact the the bot is playing a song and the
player.playing
propery is false
I'll do a check to see if there's anything in the codes interfering.
yeah try to reproduce it like explained here
GG @piton, you just advanced to level 1!
I understand, so it's something about the summary system
Solution
Thanks for the explanation, I'll fix it as soon as I finish all the changes I'm making
BTW:
Moonlink.js Version: ^3.3.76
Lavalink Version: 4.0.3
@1Lucas1.apk any updates?
Not yet, I'm going to do it tomorrow, because today my cell phone received the software update and I was unable to update the package for a while, and in a little while I'm going to school
My cell phone is freezing a little
@1Lucas1.apk the issue still persists after updating to the new version
Could you send me the volume code?
And the step by step of what you did
I want to replicate the error to correct it
quit the bot and restarted it again
and doing /volume
it breaks
GG @piton, you just advanced to level 2!
The Xotak will do a test to see if it replicates the error, if so I will try to find a lavalink that doesn't have an error so I can update it to fix it
sure, thanks
If there's a different or weird translation, it's Google Translate 👀
no problem
Could you put a console.log in node_modules?
yes
where
Before if(!this.playing) in 271 in the MoonlinkPlayer.js file, could you put console.log(this)?
sure
wait
Okay
Thank you very much
@piton Is trackStart triggered?
Now that I read the error correctly, the creation of the player is not going correctly
Error UnhandledRejection: Error: @Moonlink(PlayerManager) - Missing parameters for player creation: voiceChannel
at PlayerManager.create (C:\Users\kiko\Desktop\Miona\node_modules.pnpm\[email protected]\node_modules\moonlink.js\dist\src@Managers\PlayerManager.js:110:19)
at MoonlinkNode.message (C:\Users\kiko\Desktop\Miona\node_modules.pnpm\[email protected]\node_modules\moonlink.js\dist\src@Entities\MoonlinkNode.js:177:62)
VoiceChanne is missing

But there is also voiceChannel
In 298
Could you put
console.log(previousInfosPlayer, resumedPlayer)
In the MoonlinkNode file?
Could you do me this other favor?
in a minute
please: it's like (please)
Favor*
@1Lucas1.apk

like this?
Is different?
It's in the this.resume part of the ready event
Inside MoonlinkNode
its in TrackEndEvent
in moonlinknode

but as i can see there isnt previousInfosPlayer, nore resumedPlayer
On line 176
On top of const player, Put console.log
I was in another file instead of dist
Thanks
np
Pastebin
"use strict";Object.defineProperty(exports, "__esModule", { value:...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@piton Try replacing the code to see if that solves the problem.
On MoonlinkNode
.js
hey, i just wanted you to know that i don't have any other nodes, just one
if that makes any problems
No, no cause
Sometimes it can be script or nodejs itself
These days I was getting an error in Termux's NodeJs, I deleted everything from the environment and managed to fix it.
it tries to resume even when there are no tracks, or when the player is not playing
Now it says that there is no music playing even though its playing something

Sorry, my fault, old code that was open in the recent one, I didn't close it and open it
Now I will send the right one
okay
Pastebin
"use strict";Object.defineProperty(exports, "__esModule", { value: ...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
This is what is now
GG @piton, you just advanced to level 3!
Could you send me the complete log?
same thing, but its trying to resume in lavalink when nothing is playing, like the bot is not in the voice and its trying to resume
[ Shard: 0] Error UnhandledRejection: Error: @Moonlink(PlayerManager) - Missing parameters for player creation: voiceChannel
This error is still there
Kind of intriguing, because in the log that I requested with the information it was there, this error is preventing the player from being created correctly and resuming the connection as it should
yes, but it shouldn't resume because the bot is not in the voice
If moonlink was based entirely on lavalink rest ful yes, but how does it cache all the data so it can understand it better and faster instead of request and request for lavalink
If it were based on rest ful, the entire package process would take longer
Then the system reorganizes all the information
But somehow, your can't find the voiceChannel even though it exists
And you also need to do this reconnection, because Lavalink will disconnect if you don't make the connection attempt.
What is the nodejs version?
v21.1.0

when restarting the bot, it tries to resume but voiceChannels is null
Now it's null voiceChannel
In a log before restarting the bot, does player(id) disconnected appear?
no
And player moved?
no
In player Manager you could replace the code for this
https://pastebin.com/bzppcYGf
Some annoying logs will appear, but this is to better understand when the voiceChannel does not appear.
Then you give me the log from before "resume" and after "resume"
Pastebin
"use strict";Object.defineProperty(exports, "__esModule", { value:...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
okay
playerManager
i cleared the @Datastore
and now its working
it resumes correctly
and the volume works as well
🫥
Okay, have a great day
you too thanks
maybe you should add something in the library to remove the datastore when the bot is shut down for a long time
Thanks for the suggestion, but I was a little confused afterwards, I thought that with each update it would delete these files
But now that I know he doesn't, I'm going to make a system to delete these files.
nope still getting the same issue
i will go now
its late for me
cya tomorrow
🫥
Well, in short: the summary system (made by Lavalink, was for network complications and others, one of the ways we can test if this system works is by turning off the bot
But she doesn't have a good idea, like DJs do
Moonlink has movePlayers and autoResume, these two already do this job
AutoResume and when the bot is still connected, it managed to make Lavalink play all the applications that were previously online on it when it is reconnected
And movePlayers, it will move to another node
In the case of the resume, it is not an ideal way to do this
But if you still want this system, I'll be here tomorrow to try to help you solve the problem.
It's also not very viable for the idea, wow, I'm going to make a change while the bot is online playing for people
You can, at the exact moment, change the volume, shuffle, skip, or in the last part of playing a track, destroying another
Confusion in the data
It's not that I will make a change, but the lavalink server might stop so resume is good option to have
I understood
I fixed the playerManager, could you test it?
https://pastebin.com/dCksi4S9
Pastebin
"use strict";Object.defineProperty(exports, "__esModule", { value:...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Now it will no longer save undefined data, and also deletes @Datastore
Sorry not home
I'm home in about an hour or two
All good
same error
GG @piton, you just advanced to level 4!
It was just to test, it seems like something is being replaced, I'll fix it and you can test it
Sorry for the delay in trying to find a solution to your problem, because we couldn't replicate the error, it was normal for the tester and for me too
https://pastebin.com/fudX87zg
@piton Try now, delete @Datastore
Pastebin
"use strict";Object.defineProperty(exports, "__esModule", { value:...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Now it should work, I saw that it wasn't right, I re-coded it like I did in ts, so I compiled it again and it seems to be right now.
i've tried
and resume works
its late for me, so i will test it more tomorrow
for now it works
Okay, when you've tested it further and it works, just confirm here in the chat and I'll close this post
Have a great day :), in a day it will be corrected in the next version
@1Lucas1.apk
you can publish it
it works
now