DiscordBot icon indicating copy to clipboard operation
DiscordBot copied to clipboard

Music stops if Bot moved manually between voice channels

Open botea14 opened this issue 4 years ago • 5 comments

type: 'error', message: 'WebSocket was closed before the connection was established', error: Error: WebSocket was closed before the connection was established at WebSocket.close (/home/PantomathBot/node_modules/ws/lib/websocket.js:217:14) at VoiceWebSocket.reset (/home/PantomathBot/node_modules/discord.js/src/client/voice/networking/VoiceWebSocket.js:53:60) at VoiceWebSocket.shutdown (/home/PantomathBot/node_modules/discord.js/src/client/voice/networking/VoiceWebSocket.js:44:10) at VoiceConnection.emit (events.js:326:22) at VoiceConnection.disconnect (/home/PantomathBot/node_modules/discord.js/src/client/voice/VoiceConnection.js:352:10) at Player.stop_playing (/home/PantomathBot/plugins/MusicPlayer/player.js:178:20) at StreamDispatcher. (/home/PantomathBot/plugins/MusicPlayer/player.js:158:26) at StreamDispatcher.emit (events.js:314:20) at StreamDispatcher._setSpeaking (/home/PantomathBot/node_modules/discord.js/src/client/voice/dispatcher/StreamDispatcher.js:310:10) at /home/PantomathBot/node_modules/discord.js/src/client/voice/dispatcher/StreamDispatcher.js:296:12 } bot error1 bot error2

botea14 avatar Nov 08 '20 09:11 botea14

That doesn't really seem like a bug but more of an issue that you shouldn't move the bot when something is playing, it should be moved via command.

F9Alejandro avatar Nov 09 '20 01:11 F9Alejandro

out.log

here is the full log of the error.

The problem is not that the bot disconnects from playing music...

the bot stops when this happen.... maybe it can be solved somehow from music player... or a proteciton to only stop music from that server, and not turn off the bot :(

botea14 avatar Nov 11 '20 09:11 botea14

again using commands is the way how you are really supposed to do so safely, as the audio stream is still trying to push to the old voice channel but the bot is not in that voice channel anymore.

F9Alejandro avatar Nov 11 '20 17:11 F9Alejandro

I think fixing this would require reworking how music playback is done. #165 is a similar problem also caused by the rudimentary audio stream handling.

Einarin avatar May 18 '21 00:05 Einarin

#217 will fix this

Einarin avatar Jun 24 '22 07:06 Einarin