From e6a2a2270d34a6915b5728d34ea69814b5cd785c Mon Sep 17 00:00:00 2001 From: mjk134 <57556877+mjk134@users.noreply.github.com> Date: Sat, 9 Jul 2022 14:28:42 +0000 Subject: fix(client): Changed token reference and declaration to _token --- discord/client.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'discord') 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()) -- cgit 1.4.1-2-gfad0