diff options
| author | Rapptz <[email protected]> | 2015-12-29 12:16:37 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2015-12-29 12:17:10 -0500 |
| commit | 61464194bee115f4158a01ca4bbd823057e5c446 (patch) | |
| tree | 8ae8a6f79cdf916c88560ad80083998111d0f386 | |
| parent | Simplify parser event check with hasattr rather than tuples. (diff) | |
| download | discord.py-61464194bee115f4158a01ca4bbd823057e5c446.tar.xz discord.py-61464194bee115f4158a01ca4bbd823057e5c446.zip | |
Client.join_voice_channel now accepts an Object.
Fixes #62.
| -rw-r--r-- | discord/client.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/discord/client.py b/discord/client.py index d5d1fe7a..10e85440 100644 --- a/discord/client.py +++ b/discord/client.py @@ -2314,6 +2314,9 @@ class Client: if self.is_voice_connected(): raise ClientException('Already connected to a voice channel') + if isinstance(channel, Object): + channel = self.get_channel(channel.id) + if getattr(channel, 'type', ChannelType.text) != ChannelType.voice: raise InvalidArgument('Channel passed must be a voice channel') |