about summary refs log tree commit diff stats
path: root/discord
diff options
context:
space:
mode:
authormjk134 <57556877+mjk134@users.noreply.github.com>2022-07-09 14:28:42 +0000
committerGitHub <noreply@github.com>2022-07-09 14:28:42 +0000
commite6a2a2270d34a6915b5728d34ea69814b5cd785c (patch)
tree6d7f74af8f0cf312f917896f8bfc5749f193011e /discord
parent526f88d3356cfc7272d97e4087e87b6cb9bf6e8b (diff)
downloaddiscobra-e6a2a2270d34a6915b5728d34ea69814b5cd785c.tar.gz
fix(client): Changed token reference and declaration to _token
Diffstat (limited to 'discord')
-rw-r--r--discord/client.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/discord/client.py b/discord/client.py
index c725e3c..01e7fdd 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -42,7 +42,6 @@ class Client:
         self.buffer = bytearray()
         self.inflator = zlib.decompressobj()
         self.heartbeat_interval: int = None
-        self.token: str = None
         self.ready: bool = False
 
     async def connect(self):
@@ -77,7 +76,7 @@ class Client:
 
         if opcode != GatewayEvents.DISPATCH.value:
             if opcode == GatewayEvents.RECONNECT.value:
-                await self.gateway.close()
+                return await self.close()
 
             if opcode == GatewayEvents.HELLO.value:
                 self.heartbeat_interval = data['heartbeat_interval']
@@ -125,7 +124,7 @@ class Client:
         identify = {
             "op": GatewayEvents.IDENTIFY,
             "d": {
-                "token": self.token,
+                "token": self._token,
                 "intents": self.code,
                 "properties": {
                     "os": sys.platform,
@@ -149,5 +148,5 @@ class Client:
         """
         Run the client.
         """
-        self.token = token
-        asyncio.run(self.connect(token, self.code))
+        self._token = token
+        asyncio.run(self.connect())