Make emptydisconnect disconnect when all vc members are bots (#5421)

* [Audio] Disconnect from voice chat when every connected user is a bot

* Update condition according to code review

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
Parnassius 2021-12-26 19:09:37 +01:00 committed by GitHub
parent 6297bfcab6
commit 5a047bf979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,7 @@ class PlayerTasks(MixinMeta, metaclass=CompositeMetaClass):
if await self.bot.cog_disabled_in_guild(self, server):
continue
if [self.bot.user] == p.channel.members:
if p.channel.members and all(m.bot for m in p.channel.members):
stop_times.setdefault(server.id, time.time())
pause_times.setdefault(server.id, time.time())
else: