aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-11-16 17:23:05 -0500
committerRapptz <[email protected]>2015-11-16 17:23:05 -0500
commit3d7096602131498efd0fd4188620a7aff9fc9277 (patch)
tree58c0dda1aa31104bf70f5ce9a88924c94b2453ea
parenticon_url and get_default_channel in Server (diff)
downloaddiscord.py-3d7096602131498efd0fd4188620a7aff9fc9277.tar.xz
discord.py-3d7096602131498efd0fd4188620a7aff9fc9277.zip
Attempt to fix unavailable guilds again
-rw-r--r--discord/client.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/discord/client.py b/discord/client.py
index 38f21571..f69aad97 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -333,7 +333,8 @@ class ConnectionState(object):
self.dispatch('member_update', member)
def handle_guild_create(self, data):
- if data.get('unavailable') is not None:
+ unavailable = data.get('unavailable', False)
+ if unavailable == False:
# GUILD_CREATE with unavailable in the response
# usually means that the server has become available
# and is therefore in the cache
@@ -343,6 +344,10 @@ class ConnectionState(object):
self.dispatch('server_available', server)
return
+ if unavailable == True:
+ # joined a server with unavailable == True so..
+ return
+
# if we're at this point then it was probably
# unavailable during the READY event and is now
# available, so it isn't in the cache...