diff options
| author | SuzuZusu <[email protected]> | 2021-02-24 21:14:42 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-24 21:14:42 -0500 |
| commit | b903066e4dcc967dcc11ac9fa9be23840885fce4 (patch) | |
| tree | 3f315976ee7302f95d5641984fe428f6cfd80091 /discord/abc.py | |
| parent | [commands] Added tribool behaviour to HelpCommand.verify_checks (diff) | |
| download | discord.py-b903066e4dcc967dcc11ac9fa9be23840885fce4.tar.xz discord.py-b903066e4dcc967dcc11ac9fa9be23840885fce4.zip | |
Allow for callable class factories in abc.Connectable.connect
Diffstat (limited to 'discord/abc.py')
| -rw-r--r-- | discord/abc.py | 7 |
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: |