aboutsummaryrefslogtreecommitdiff
path: root/discord/gateway.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2020-04-04 01:42:08 -0400
committerRapptz <[email protected]>2020-04-04 01:42:08 -0400
commit403651a1440260cb46f42d68a82ee35e193a350d (patch)
treebf3a942558b13669f14fdc8e717299acdaf20992 /discord/gateway.py
parentFixed missing awaits in subclassed coros (diff)
downloaddiscord.py-403651a1440260cb46f42d68a82ee35e193a350d.tar.xz
discord.py-403651a1440260cb46f42d68a82ee35e193a350d.zip
Change default close code to 4000 instead of 1000.
This prevents our sessions from being invalidated by Discord which caused a lot of failures when resuming. This caused an unnecessary amount of IDENTIFYs to happen depending on the circumstances. Closes #2631 See also discord/discord-api-docs#1472
Diffstat (limited to 'discord/gateway.py')
-rw-r--r--discord/gateway.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/gateway.py b/discord/gateway.py
index 3561033b..0e90c5f6 100644
--- a/discord/gateway.py
+++ b/discord/gateway.py
@@ -543,7 +543,7 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
log.debug('Updating our voice state to %s.', payload)
await self.send_as_json(payload)
- async def close(self, code=1000, reason=''):
+ async def close(self, code=4000, reason=''):
if self._keep_alive:
self._keep_alive.stop()