'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
Hello, I'm going to analyze the codes to see if I shouldn't have put them
passive-yellowOP•2y ago
okay thanks
I analyzed the lines of code that have this part, and they are so correct
?play disfruto

<: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
Carla Morrison - Disfruto (letra) is playing now
passive-yellowOP•2y 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)this is the right one
passive-yellowOP•2y ago
okay thanks
I am checking if trackEnd is emitted
passive-yellowOP•2y ago
awesome thank you, let me know 😀
as musicas acabaram
?play gatinho loli gemendo

<: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
?play gatinho loli gemendo

<: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
as musicas acabaram
?play gatinho loli gemendo

<: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
Gatinho gemendo com voz de loli is playing now
?play gatinho loli gemendo

<: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
passive-yellowOP•2y 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.
GG @JDOG, you just advanced to level 1!
as musicas acabaram
issued

passive-yellowOP•2y ago
so it is just something wrong with my code then?

The trackEnd is issued when there are tracks in the queue, if the queueEnd is not issued
Give me part of this code
passive-yellowOP•2y 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);
...
Did you test with more than one song in the queue?
passive-yellowOP•2y ago
No, there needs to be more than one song?
Yes, because if only one song has been played and there is no track in the queue, queueEnd is issued instead of trackEnd
passive-yellowOP•2y ago
ahhh, thank you! I will test that right now
Have a great day 🙂
passive-yellowOP•2y 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!
I'm working on the documentation this week, probably in about 3 weeks it will be complete
passive-yellowOP•2y ago
Cool, is this client library relatively new?
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-yellowOP•2y ago
gotcha, well yours seems like the best library for lavalink, so keep at it 🔥
You're welcome, if you have any other questions just come here, I'll do my best to help you
passive-yellowOP•2y ago
Thanks, will do!