Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Music stops if Bot moved manually between voice channels #171

Open
botea14 opened this issue Nov 8, 2020 · 5 comments
Open

Music stops if Bot moved manually between voice channels #171

botea14 opened this issue Nov 8, 2020 · 5 comments

Comments

@botea14
Copy link

botea14 commented Nov 8, 2020

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

@F9Alejandro
Copy link
Collaborator

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.

@botea14
Copy link
Author

botea14 commented Nov 11, 2020

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 :(

@F9Alejandro
Copy link
Collaborator

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.

@Einarin
Copy link
Collaborator

Einarin commented May 18, 2021

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
Copy link
Collaborator

Einarin commented Jun 24, 2022

#217 will fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants