'trackEnd' Listener never being called

I have the trackEnd listener intialized like so: client.moon.on('trackEnd', async(player, track) => { console.log("TRACK ENDED"); }); But I never see "TRACK ENDED" being printed to the console, my 'trackStart' works, just not the trackEnd listener. Was wondering if there were any common problems for this?
41 Replies
1Lucas1.apk
1Lucas1.apk2y ago
Hello, I'm going to analyze the codes to see if I shouldn't have put them
passive-yellow
passive-yellowOP2y ago
okay thanks
1Lucas1.apk
1Lucas1.apk2y ago
I analyzed the lines of code that have this part, and they are so correct ?play disfruto
Blobit - Moonlink.js
discordlogo Music.
<:Nota_Musica__Mlink:960665601574055966>╺╸Title:
<:Estrela_Mlink:960660485999587348>╺╸Uri:
<:emoji_21:967836966714503168>╺╸Author:
Carla Morrison
<:emoji_23:967837516558393365>╺╸Duration:
0 Days, 0 Hours, 4 Minutes, 247 Seconds
Request for: 1lucas1.apk
Blobit - Moonlink.js
Carla Morrison - Disfruto (letra) is playing now
passive-yellow
passive-yellowOP2y ago
Hmmm, what is the correct way of grabbing the player object then? I am using: client.moon.players.get(guildId); (wondering if this could be the problem)
1Lucas1.apk
1Lucas1.apk2y ago
this is the right one
passive-yellow
passive-yellowOP2y ago
okay thanks
1Lucas1.apk
1Lucas1.apk2y ago
I am checking if trackEnd is emitted
passive-yellow
passive-yellowOP2y ago
awesome thank you, let me know 😀
Blobit - Moonlink.js
as musicas acabaram
1Lucas1.apk
1Lucas1.apk2y ago
?play gatinho loli gemendo
Blobit - Moonlink.js
discordlogo Music.
<:Nota_Musica__Mlink:960665601574055966>╺╸Title:
<:Estrela_Mlink:960660485999587348>╺╸Uri:
<:emoji_21:967836966714503168>╺╸Author:
THEmonio 炎
<:emoji_23:967837516558393365>╺╸Duration:
0 Days, 0 Hours, 0 Minutes, 30 Seconds
Request for: 1lucas1.apk
1Lucas1.apk
1Lucas1.apk2y ago
?play gatinho loli gemendo
Blobit - Moonlink.js
discordlogo Music.
<:Nota_Musica__Mlink:960665601574055966>╺╸Title:
<:Estrela_Mlink:960660485999587348>╺╸Uri:
<:emoji_21:967836966714503168>╺╸Author:
THEmonio 炎
<:emoji_23:967837516558393365>╺╸Duration:
0 Days, 0 Hours, 0 Minutes, 30 Seconds
Request for: 1lucas1.apk
Blobit - Moonlink.js
as musicas acabaram
1Lucas1.apk
1Lucas1.apk2y ago
?play gatinho loli gemendo
Blobit - Moonlink.js
discordlogo Music.
<:Nota_Musica__Mlink:960665601574055966>╺╸Title:
<:Estrela_Mlink:960660485999587348>╺╸Uri:
<:emoji_21:967836966714503168>╺╸Author:
THEmonio 炎
<:emoji_23:967837516558393365>╺╸Duration:
0 Days, 0 Hours, 0 Minutes, 30 Seconds
From An unknown user
Request for: 1lucas1.apk
Blobit - Moonlink.js
Gatinho gemendo com voz de loli is playing now
1Lucas1.apk
1Lucas1.apk2y ago
?play gatinho loli gemendo
Blobit - Moonlink.js
discordlogo Music.
<:Nota_Musica__Mlink:960665601574055966>╺╸Title:
<:Estrela_Mlink:960660485999587348>╺╸Uri:
<:emoji_21:967836966714503168>╺╸Author:
THEmonio 炎
<:emoji_23:967837516558393365>╺╸Duration:
0 Days, 0 Hours, 0 Minutes, 30 Seconds
From An unknown user
Request for: 1lucas1.apk
passive-yellow
passive-yellowOP2y ago
it seems like only sometimes the 'trackStart' is triggered as well. It seems random at this point, it could be my code but also not sure.
MEE6
MEE62y ago
GG @JDOG, you just advanced to level 1!
Blobit - Moonlink.js
as musicas acabaram
1Lucas1.apk
1Lucas1.apk2y ago
issued
No description
passive-yellow
passive-yellowOP2y ago
so it is just something wrong with my code then?
1Lucas1.apk
1Lucas1.apk2y ago
No description
1Lucas1.apk
1Lucas1.apk2y ago
The trackEnd is issued when there are tracks in the queue, if the queueEnd is not issued Give me part of this code
passive-yellow
passive-yellowOP2y ago
Here is where my client stuff is initialized: client.moon = new MoonlinkManager([{ host: 'localhost', port: 2333, secure: false, password: lavalinkPassword }], { /* Option */ }, (guild, sPayload) => { client.guilds.cache.get(guild).shard.send(JSON.parse(sPayload)) }); //emit to the console the node was connected to client.moon.on('nodeCreate', (node) => { console.log('${node.host} was connected'); }); client.moon.on('trackStart', async(player, track) => { console.log("TRACK STARTED"); }); client.moon.on('trackEnd', async(player, track) => { console.log("TRACK ENDED"); }); client.on('ready', async () => { client.moon.init(client.user.id); ...
1Lucas1.apk
1Lucas1.apk2y ago
Did you test with more than one song in the queue?
passive-yellow
passive-yellowOP2y ago
No, there needs to be more than one song?
1Lucas1.apk
1Lucas1.apk2y ago
Yes, because if only one song has been played and there is no track in the queue, queueEnd is issued instead of trackEnd
passive-yellow
passive-yellowOP2y ago
ahhh, thank you! I will test that right now
1Lucas1.apk
1Lucas1.apk2y ago
Have a great day 🙂
passive-yellow
passive-yellowOP2y ago
yup, I added the 'queueEnd' listener and that is triggered when there is only one song. I would specify that in your documentation if possible 👍 And thanks you too!
1Lucas1.apk
1Lucas1.apk2y ago
I'm working on the documentation this week, probably in about 3 weeks it will be complete
passive-yellow
passive-yellowOP2y ago
Cool, is this client library relatively new?
1Lucas1.apk
1Lucas1.apk2y ago
Let's say that when there are updates, I didn't update the documentation, so since I'm still studying, I don't have much time Then I was making small updates, this week I dedicated a little more, since I'm practically passed the year, at the end of the year I rest a little, then I dedicate a little more time to the package
passive-yellow
passive-yellowOP2y ago
gotcha, well yours seems like the best library for lavalink, so keep at it 🔥
1Lucas1.apk
1Lucas1.apk2y ago
You're welcome, if you have any other questions just come here, I'll do my best to help you
passive-yellow
passive-yellowOP2y ago
Thanks, will do!

Did you find this page helpful?