aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2020-04-07 07:59:09 -0400
committerRapptz <[email protected]>2020-07-25 09:59:38 -0400
commit45cb231161ef890472a5e97a43c1425a63462805 (patch)
treecec76526753241469ba8e145e760b1463b67f18f
parentCan't use %d in here (diff)
downloaddiscord.py-45cb231161ef890472a5e97a43c1425a63462805.tar.xz
discord.py-45cb231161ef890472a5e97a43c1425a63462805.zip
Fix AttributeError on reconnection
-rw-r--r--discord/shard.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/discord/shard.py b/discord/shard.py
index ad564bb2..f2feaecb 100644
--- a/discord/shard.py
+++ b/discord/shard.py
@@ -40,9 +40,9 @@ from .enums import Status
log = logging.getLogger(__name__)
class EventType:
- Close = 0
- Resume = 1
- Identify = 2
+ close = 0
+ resume = 1
+ identify = 2
class Shard:
def __init__(self, ws, client):
@@ -61,7 +61,7 @@ class Shard:
self._task = self.loop.create_task(self.worker())
async def worker(self):
- while True:
+ while not self._client.is_closed():
try:
await self.ws.poll_event()
except ReconnectWebSocket as e: