check both connect and speak permissions before performing audio actions (#5012)

This commit is contained in:
Draper
2021-05-19 21:29:40 +01:00
committed by GitHub
parent f3231682b0
commit 994137426f
7 changed files with 38 additions and 18 deletions

View File

@@ -338,8 +338,7 @@ class LavalinkEvents(MixinMeta, metaclass=CompositeMetaClass):
self._ws_op_codes[guild_id]._init(self._ws_op_codes[guild_id]._maxsize)
return
if player.channel:
current_perms = player.channel.permissions_for(player.guild.me)
has_perm = current_perms.speak and current_perms.connect
has_perm = self.can_join_and_speak(player.channel)
else:
has_perm = False
if code in (1000,) and has_perm and player.current and player.is_playing: