From de65f7309bc8f8c931f29dcd76ebd9e8b0ee547b Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 8 Aug 2017 21:12:04 -0400 Subject: Add heartbeat_timeout to the Client options. This setting configures how long before a timeout event is emitted internally and disconnects the websocket. Since some users were experiencing issues with the gateway not responding, this should help mitigate the issue for those with poor PCs. --- discord/state.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'discord/state.py') diff --git a/discord/state.py b/discord/state.py index a8d4ffe7..0511b754 100644 --- a/discord/state.py +++ b/discord/state.py @@ -64,6 +64,7 @@ class ConnectionState: self.shard_count = None self._ready_task = None self._fetch_offline = options.get('fetch_offline_members', True) + self.heartbeat_timeout = options.get('heartbeat_timeout', 60.0) self._listeners = [] game = options.get('game', None) @@ -907,7 +908,6 @@ class AutoShardedConnectionState(ConnectionState): launch.set() yield from asyncio.sleep(2.0 * self.shard_count, loop=self.loop) - if self._fetch_offline: guilds = sorted(self._ready_state.guilds, key=lambda g: g.shard_id) -- cgit v1.2.3