aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-07-15 21:34:39 -0400
committerRapptz <[email protected]>2016-07-15 21:34:39 -0400
commitc7f99afe7e56cc5fad865423de1e0d65eeeb38a5 (patch)
tree898a8136c7b4a4e21f661ab2b3fa273a5eb2db69
parentAdd remaining server regions to the enum. (diff)
downloaddiscord.py-c7f99afe7e56cc5fad865423de1e0d65eeeb38a5.tar.xz
discord.py-c7f99afe7e56cc5fad865423de1e0d65eeeb38a5.zip
Handle private channel CHANNEL_CREATE better.
-rw-r--r--discord/state.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/state.py b/discord/state.py
index cd65ba46..7a8fc466 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -312,9 +312,9 @@ class ConnectionState:
self.dispatch('channel_update', old_channel, channel)
def parse_channel_create(self, data):
- is_private = data.get('is_private', False)
+ ch_type = try_enum(ChannelType, data.get('type'))
channel = None
- if is_private:
+ if ch_type in (ChannelType.group, ChannelType.private):
channel = PrivateChannel(self.user, **data)
self._add_private_channel(channel)
else: