|
|
@ -113,6 +113,7 @@ class ConnectionState: |
|
|
|
self.hooks = hooks |
|
|
|
self.shard_count = None |
|
|
|
self._ready_task = None |
|
|
|
self.application_id = utils._get_as_snowflake(options, 'application_id') |
|
|
|
self.heartbeat_timeout = options.get('heartbeat_timeout', 60.0) |
|
|
|
self.guild_ready_timeout = options.get('guild_ready_timeout', 2.0) |
|
|
|
if self.guild_ready_timeout < 0: |
|
|
@ -452,6 +453,14 @@ class ConnectionState: |
|
|
|
self.user = user = ClientUser(state=self, data=data['user']) |
|
|
|
self._users[user.id] = user |
|
|
|
|
|
|
|
if self.application_id is None: |
|
|
|
try: |
|
|
|
application = data['application'] |
|
|
|
except KeyError: |
|
|
|
pass |
|
|
|
else: |
|
|
|
self.application_id = utils._get_as_snowflake(application, 'id') |
|
|
|
|
|
|
|
for guild_data in data['guilds']: |
|
|
|
self._add_guild_from_data(guild_data) |
|
|
|
|
|
|
@ -1153,6 +1162,14 @@ class AutoShardedConnectionState(ConnectionState): |
|
|
|
self.user = user = ClientUser(state=self, data=data['user']) |
|
|
|
self._users[user.id] = user |
|
|
|
|
|
|
|
if self.application_id is None: |
|
|
|
try: |
|
|
|
application = data['application'] |
|
|
|
except KeyError: |
|
|
|
pass |
|
|
|
else: |
|
|
|
self.application_id = utils._get_as_snowflake(application, 'id') |
|
|
|
|
|
|
|
for guild_data in data['guilds']: |
|
|
|
self._add_guild_from_data(guild_data) |
|
|
|
|
|
|
|