jagrosh / MusicBot

🎶 A Discord music bot that's easy to set up and run yourself!
https://jmusicbot.com
Apache License 2.0
5.29k stars 2.54k forks source link

[Feature Request] Leave VC when sharing the channel with only bots #1029

Closed MaikKrisanov closed 2 years ago

MaikKrisanov commented 2 years ago

Is your feature request related to a problem? Please describe.

When using two separate instances of the music bots (or other bots) and then leaving the Voice Channel, the bots do not automatically leave the channel.

What is your ideal solution to the problem?

When the bot shares the channel only with other bots, it leaves the channel.

How would this feature be used?

  1. Have the bot join a voice channel.
  2. Have a different, unrelated bot join the voice channel.
  3. Leave the voice channel.
  4. MusicBot is now expected to leave the voice channel after a certain amount of time.

Additional Info

No response

Checklist

jagrosh commented 2 years ago

This is already what the alonetimeuntilstop field in the config is for. Bots and users that are deafened do not count as "listening", and therefore don't count against the bot considering itself "alone."

jagrosh commented 2 years ago

https://github.com/jagrosh/MusicBot/blob/master/src/main/java/com/jagrosh/jmusicbot/audio/AloneInVoiceHandler.java#L90-L97