amishshah / ytdl-core-discord

A ytdl-core wrapper focused on efficiency for use in Discord music bots
Apache License 2.0
67 stars 26 forks source link

StreamDispatcher finish event not firing #395

Closed eugabrielsilva closed 1 year ago

eugabrielsilva commented 3 years ago

Using discord.js v12.5.3 and Node v16, the StreamDispatcher (when played through ytdl-core-discord) does not properly fire the "finish" event after the "end()" method is called.

eugabrielsilva commented 3 years ago

Actually find out that after the "end()" method is called while playing through ytdl, an ERR_STREAM_WRITE_AFTER_END error is thrown. Solved by myself chaning from "end()" to "destroy()" and listening for the "close" event instead of "finish".

eugabrielsilva commented 3 years ago

Actually the problem was not solved. Listening for the 'close' event makes the music to stop randomly.

eugabrielsilva commented 1 year ago

Problem solved in newer versions of ytdl and discordjs/voice.