about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authormjk134 <57556877+mjk134@users.noreply.github.com>2022-07-12 18:57:37 +0000
committerGitHub <noreply@github.com>2022-07-12 18:57:37 +0000
commited6b3229c97b7d9003e52637f9c48ac08ceef21c (patch)
treed861d16d6deea4952b573bbb442f75cf505ca25f
parent5e54ae9fdcf0dccae8337dd4a394007701dddbd6 (diff)
downloaddiscobra-ed6b3229c97b7d9003e52637f9c48ac08ceef21c.tar.gz
fix(client): Bug with not receiving events as soon as they are fired
-rw-r--r--discord/client.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py
index b68edbb..3c15abd 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -80,7 +80,6 @@ class Client:
     rest_client: RESTClient
     client_cache: ClientCache = ClientCache()
 
-    @property
     async def user(self):
         """The `discord.user.User` associated with the client."""
         data = await self.rest_client.get('/users/@me')
@@ -172,6 +171,8 @@ class Client:
 
         event = msg['t']
 
+        print(f"{event}")
+
         match(event):
             case 'READY':
                 self.ready = True
@@ -259,7 +260,7 @@ class Client:
 
     async def poll_event(self):
         async for msg in self.gateway:
-            if msg.type == aiohttp.WSMsgType.TEXT:
+            if msg.type in (aiohttp.WSMsgType.TEXT, aiohttp.WSMsgType.BINARY):
                 await self.recv(msg.data)
             elif msg.type == aiohttp.WSMsgType.CLOSED:
                 break