Koenie06 / Discord.js-Music

19 stars 13 forks source link

playSong event fires 3-5 times #15

Open Pentrucine opened 2 years ago

Pentrucine commented 2 years ago

Hello, I really appreciate your work. It made everything so much easier moving to v13. There is only 1 issue I am encountering. I made my code send a message whenever the event playSong triggers. I've made sure that my code only triggers the music.play command only once, but still the event triggers at least 3 times. It seems that on the first song, everything seems to work fine, but after the first song, or after the music.stop command, the issue start occurring. Am I doing something wrong or does the event actually trigger multiple times.

One thing that I am not sure may be causing the issue is I am still using messageCreate and not interaction. But I overcome this by setting the interaction in the command as message like so:music.play({interaction: message,channel: voiceChannel,song: search});Just FYI if this might be important.

music.event.on('playSong', (channel, songInfo, requester) => {
        message.channel.send({ content: `Now playing: ${songInfo.title}`});
    }}); 
Koenie06 commented 2 years ago

Is it just a fault in your message on github here, or did you use message,channel with comma.. :? If it is a dot it should work fine. Maybe try to install the latest version of the package?