From 5444da655a90fdd6aed761a7e97d60ea3ddd89e6 Mon Sep 17 00:00:00 2001 From: Michael H Date: Fri, 8 Feb 2019 10:32:27 -0500 Subject: [PATCH] [V2 Audio] Fixes channel full error while bot is in channel (#1924) * This fixes #1643 * put the correct type for v2 * Update audio.py Apply this previous change to the other applicable case. * whitespace * fracking web-editor --- cogs/audio.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cogs/audio.py b/cogs/audio.py index 6a3bdf0fc..101b24500 100644 --- a/cogs/audio.py +++ b/cogs/audio.py @@ -2251,6 +2251,7 @@ class Audio: channel = author.voice_channel if channel: + in_channel = bool(server.me in channel.voice_members) is_admin = channel.permissions_for(server.me).administrator if channel.user_limit == 0: is_full = False @@ -2259,11 +2260,11 @@ class Audio: if channel is None: raise AuthorNotConnected - elif channel.permissions_for(server.me).connect is False: + elif channel.permissions_for(server.me).connect is False and not in_channel: raise UnauthorizedConnect elif channel.permissions_for(server.me).speak is False: raise UnauthorizedSpeak - elif is_full and not is_admin: + elif is_full and not is_admin and not in_channel: raise ChannelUserLimit else: return True