aboutsummaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
authorSuzuZusu <[email protected]>2021-02-24 21:14:42 -0500
committerGitHub <[email protected]>2021-02-24 21:14:42 -0500
commitb903066e4dcc967dcc11ac9fa9be23840885fce4 (patch)
tree3f315976ee7302f95d5641984fe428f6cfd80091 /discord
parent[commands] Added tribool behaviour to HelpCommand.verify_checks (diff)
downloaddiscord.py-b903066e4dcc967dcc11ac9fa9be23840885fce4.tar.xz
discord.py-b903066e4dcc967dcc11ac9fa9be23840885fce4.zip
Allow for callable class factories in abc.Connectable.connect
Diffstat (limited to 'discord')
-rw-r--r--discord/abc.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/discord/abc.py b/discord/abc.py
index dcd9279e..a86a2a2d 100644
--- a/discord/abc.py
+++ b/discord/abc.py
@@ -1138,9 +1138,6 @@ class Connectable(metaclass=abc.ABCMeta):
A voice client that is fully connected to the voice server.
"""
- if not issubclass(cls, VoiceProtocol):
- raise TypeError('Type must meet VoiceProtocol abstract base class.')
-
key_id, _ = self._get_voice_client_key()
state = self._state
@@ -1149,6 +1146,10 @@ class Connectable(metaclass=abc.ABCMeta):
client = state._get_client()
voice = cls(client, self)
+
+ if not isinstance(voice, VoiceProtocol):
+ raise TypeError('Type must meet VoiceProtocol abstract base class.')
+
state._add_voice_client(key_id, voice)
try: