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

Can't leave voice channel if rebooted #3417

Closed
1 task
WilsontheWolf opened this issue Aug 2, 2019 · 3 comments
Closed
1 task

Can't leave voice channel if rebooted #3417

WilsontheWolf opened this issue Aug 2, 2019 · 3 comments

Comments

@WilsontheWolf
Copy link
Contributor

WilsontheWolf commented Aug 2, 2019

Failure to leave a vc when rebooted. Code works fine if the bot isn't rebooted.

image

let vc = message.guild.members.get(client.user.id).voiceChannel
  if(!vc){
    message.channel.send('I need to be in a voice channel to leave')}
  else{
    message.channel.send(`Leaving \`${vc.name}\``)
    vc.leave()}

Further details:

  • discord.js version:11.5.0
  • Node.js version:v9.11.2
  • Operating system: linux (glitch)
  • Priority this issue should have – please be realistic and elaborate if possible: low
  • I have also tested the issue on latest master, commit hash:
@Fyko
Copy link
Contributor

Fyko commented Aug 2, 2019

Can reproduce on the lastest master hash.

In your reboot command, please do Client#destroy before you process.exit(). Doing so will terminate all voice connections and safely destroy the websocket.

@amishshah
Copy link
Member

This isn't a bug, if you reboot your bot without destroying it first or leaving any voice channels (as @Fyk0 said) then Discord will not know that your bot has been disconnected and assume it is still in the voice channel for about 40 seconds. The only way to get around this is to destroy your client before rebooting, or by leaving the channel before rebooting.

@WilsontheWolf
Copy link
Contributor Author

WilsontheWolf commented Aug 2, 2019

ok will do

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants