<MoonlinkPlayer>.skip() bug
When using the skip method, the <MoonlinkPlayer>.playing is returned to false
96 Replies
NodeLink Server Log
When I checked about the MoonlinkPlayer by eval (two queues and skip)
No trackStart event occurs either
fascinating-indigo•8mo ago
Coincidence, that's a bug I literally fixed some few hours ago
Just update your NodeLink and it should be fine
Sorry for the trouble
Ahh i will try
fascinating-indigo•8mo ago
(For updating NL, just git pull)
same happened
fascinating-indigo•8mo ago
Mind providing newest logs from NL?
& could provide me what's the output of the command git log?
give me second
fascinating-indigo•8mo ago
Sure
never mind now its work 😂
fascinating-indigo•8mo ago
If you have any other bug with NodeLink, feel free to create a GitHub issue instead
The logs are very useful to know if it's a NodeLink bug or a client bug. If they don't say anything, and it should, then it's NodeLink mostly LMAO
Feel free to DM me for any bug confirmation, but hopefully you won't find any more :)
Thank you for always actively helping 🙂
I thought I wrote the code wrong
fascinating-indigo•8mo ago
And thanks for supporting small projects ^^
🤣
I'm sorry for the trouble btw
@ThePedroo Sorry for ping
When playing a song, I try to adjust the sound using <MoonlinkPlayer>.setVolume(), but it's not a NodeLink problem to return the error just because the player hasn't played yet, right?
fascinating-indigo•8mo ago
I wouldn't define it as a problem as this is made on purpose
But if you either try to pause or stop a player which doesn't have a playing player, it will do that
not set volume though
Also, dw about pinging me, I preffer that people ping me or else I won't see it till maybe days
The user tried to set the volume value when trying to play the song.
But I don't think the player was created in the meantime
GG @Jasper, you just advanced to level 3!
like that
fascinating-indigo•8mo ago
Mind enabling
all
logs in config.js and showing the logs?NodeLink ?
fascinating-indigo•8mo ago
Yes, there is a logging called
all
Are these logs correct?
fascinating-indigo•8mo ago
Kinda of, let me see the crash in the end
It's weird how some people can get some issues others can't
Sorry 😂
fascinating-indigo•8mo ago
For what? 👀
I mean, I'm sorry that I brought so many weird errors 😭
fascinating-indigo•8mo ago
Oh, I love when people send me then
Makes the project more stable
If i provide a delay with setTimeout, there will be no problem, but if i process it with then, an error will occur
fascinating-indigo•8mo ago
Anyway, this happened because the client disconnected before NodeLink could actually process the play request -- so I'm not sending it to you a fix for that right now to wait me find a proper solution and send to the repo, as it's not an urgency
However we must find the reason of why the client is disconnecting
Mind providing your bot logs?
Probably can't wait on Moonlink for Player to be created
fascinating-indigo•8mo ago
Some error is causing Moonlink to disconnect in this case
fascinating-indigo•8mo ago
Ahh, that's a internal Moonlink error
I thought it was a nodelink error 🤣
yeah thats right XD
fascinating-indigo•8mo ago
The most appropriate case for this would be listening to trackStart event and set it
umm
fascinating-indigo•8mo ago
orrrrrrrrrrr
I think that would be good, too
fascinating-indigo•8mo ago
sending the volume together with play
Sending together is more appropriate
If i do this, it'll be output at the default sound value for about a second
fascinating-indigo•8mo ago
Yeah
I thought that first but then I realized there are better ways
If I do this, the Player will be created late, and the same error will occur
fascinating-indigo•8mo ago
Not really
It will be sent in the same payload
Let me see if I can find the example which does that
Async function included play and set volume method and exec
wrong code?
fascinating-indigo•8mo ago
NodeLink accuses it to be sending volume 80% on-the-play
So somewhere does that
umm
fascinating-indigo•8mo ago
Before .play
Use
player.volume = selected_data?.volume || 50
Does it mean to set the <MoonlinkPlayer>.volume property?
fascinating-indigo•8mo ago
Yes
Its work :happypepe:
fascinating-indigo•8mo ago
@1Lucas1.apk Aliás, você tem que rever isso
Porque não tem como fazer o que ele quer sem fazer dessa forma -- exceto se for assim mesmo que tu queria que fizessem
fascinating-indigo•8mo ago
The NL logs seems fine
Yeah 🙂
fascinating-indigo•8mo ago
Awesome! :)
Lmk if you have any further issues or questions
I'm always grateful that you've helped me in something that's not a big deal ❤️
fascinating-indigo•8mo ago
That's what I call open source community ^^
But his If is wrong...
If(player.playing) without the question mark, it will try to emit every time it is not playing
fascinating-indigo•8mo ago
Wouldn't affect anything at normal case though
Affects
fascinating-indigo•8mo ago
Não afeta o problema que ele queria resolver
Ele queria setar o volume ao tocar
Tentar mudar um volume em um player que não tá tocando??
fascinating-indigo•8mo ago
Não
Ele queria setar o volume on-the-play
É o que o comando faz
fascinating-indigo•8mo ago
Mas a única forma de fazer isso é mudando o this.volume direto
Isso não é on-the-play, ele não vai junto ao pedido pra tocar
Precisa ser no mesmo payload
Só era colocar no create
fascinating-indigo•8mo ago
Seria útil no play tu deixar a pessoa fazer on-the-play de qualquer forma
É útil pra reduzir latência porque aí vai tudo no mesmo request
Vou encher de ifs se eu fizer
fascinating-indigo•8mo ago
KKKKK é só adicionar um parâmetro no play pra enviar coisa junta
Usa create
fascinating-indigo•8mo ago
Mas e depois no segundo play e se ele quiser alterar o volume?
Altera o parâmetro
fascinating-indigo•8mo ago
Qual?
volume
fascinating-indigo•8mo ago
this.volume?
Ele é sempre acionado junto com o play
fascinating-indigo•8mo ago
Se for o this.volume foi oq foi usado mesmo
GitHub
moonlink.js/src/@Entities/MoonlinkPlayer.ts at v3 · Ecliptia/moonli...
MoonLink.js is a simple package for lavalink client, perfect for you to create your discord bot with songs, and very simple and easy to use. - Ecliptia/moonlink.js
fascinating-indigo•8mo ago
Sim, por isso eu falei pra usar o this.volume
Aliás, eu não tinha achado como alterar o volume no create
what happened
GG @Jasper, you just advanced to level 4!
fascinating-indigo•8mo ago
^
Seems like you also set the volume on the create function too
When using the command, we implemented the track to be selected and played by the user based on the search. I was just trying to adjust the volume based on the selection.
For now, I wrote the code as above.
fascinating-indigo•8mo ago
To change the volume on-the-play, seems like this is the only way
i think so
fascinating-indigo•8mo ago
@1Lucas1.apk ?
It's been a while since I've studied typescript, so the code can be terrible 😂
GitHub
moonlink.js/src/@Entities/MoonlinkPlayer.ts at v3 · Ecliptia/moonli...
MoonLink.js is a simple package for lavalink client, perfect for you to create your discord bot with songs, and very simple and easy to use. - Ecliptia/moonlink.js
Tudo que vem do construtor é usado
Desde autoPlay até node
Se quiser colocar que ele já venha com connected e playing pode até colocar 😘
fascinating-indigo•8mo ago
ATA
Por isso que não vi explicitamente
As long as it works -- but it's always important to keep the code clean
I'll do my best. 🙂
fascinating-indigo•8mo ago
If you need any help with making a code more readable, count on us too :)