Just-Some-Bots / MusicBot

:musical_note: The original MusicBot for Discord (formerly SexualRhinoceros/MusicBot)
https://just-some-bots.github.io/MusicBot/
MIT License
3.14k stars 2.36k forks source link

Autoplaylist is not checking user present on start #1477

Closed falcon4fun closed 6 years ago

falcon4fun commented 6 years ago

I have found quite an old bug. It's like a bot doesn't verifies if there is somebody in the voice while using:

  1. Autoconnect to channel on start
  2. Autoplay enabled
  3. Autopause enabled

I have found that every time when bot starts/relaunches, it starts to play music on all servers even nobody in the voice. And the solution is enter to voice and exit, then bot see that Can you try reproduce? (: If ya, add initial checking. I tryed to do it by my self, but failed (:

To reproduce:

  1. Enable ^ 3 options
  2. Add some tracks to autoplaylist.txt
  3. Launch bot
  4. Go to your TEXT channel and write !np and see, that music is playing but it should not :) Tryed on review build. Still present.. :) https://i.imgur.com/bV88mLx.png

https://cdn.discordapp.com/attachments/252967574168535040/404804293648973835/unknown.png https://pastebin.com/hMrNFYYT

itsTheFae commented 6 years ago

I've noticed this as well.
There is a check coded in _join_startup_channels() but the conditions as they are now have a little issue which prevents the one-shot lambda from being run. I've created a patch for this as well as Issue #1482 targeting the latest review branch.

Devs can find the patch commits here: https://github.com/itsTheFae/DiscordMusicBot/tree/patch-auto-pause

falcon4fun commented 6 years ago

I have found that sometimes it works.. I disabled equalisation.

In log:

Initial autopause in empty channel Initial autopause in empty channel

itsTheFae commented 6 years ago

In my case, the bot is always restoring a serialized queue when it starts. I suspect the restoration of the queue might contribute to the auto-pause failure condition on this issue as well as mine..
Not totally sure, I trust the devs here would know better than me.

jayktaylor commented 6 years ago

Should've been fixed by the above PR.