aboutsummaryrefslogtreecommitdiff
path: root/discord/shard.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-08-22 03:05:22 -0400
committerRapptz <[email protected]>2021-08-22 03:05:22 -0400
commit1b5c2062792e1c5b5a37dee56fc440c8fc71482c (patch)
treeadc1edacb45cbad800d40538434447400c106288 /discord/shard.py
parentMake __main__ template strings private (diff)
downloaddiscord.py-1b5c2062792e1c5b5a37dee56fc440c8fc71482c.tar.xz
discord.py-1b5c2062792e1c5b5a37dee56fc440c8fc71482c.zip
Fix broken rename from pyright
Diffstat (limited to 'discord/shard.py')
-rw-r--r--discord/shard.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/discord/shard.py b/discord/shard.py
index 2a00a6a9..edbdebf4 100644
--- a/discord/shard.py
+++ b/discord/shard.py
@@ -153,10 +153,10 @@ class Shard:
return
if e.code != 1000:
self._queue_put(EventItem(EventType.close, self, e))
- _log return
+ return
retry = self._backoff.delay()
- log.error('Attempting a reconnect for shard ID %s in %.2fs', self.id, retry, exc_info=e)
+ _log.error('Attempting a reconnect for shard ID %s in %.2fs', self.id, retry, exc_info=e)
await asyncio.sleep(retry)
self._queue_put(EventItem(EventType.reconnect, self, e))
@@ -178,10 +178,10 @@ class Shard:
break
async def reidentify(self, exc: ReconnectWebSocket) -> None:
- _logf._cancel_task()
+ self._cancel_task()
self._dispatch('disconnect')
self._dispatch('shard_disconnect', self.id)
- log.info('Got a request to %s the websocket at Shard ID %s.', exc.op, self.id)
+ _log.info('Got a request to %s the websocket at Shard ID %s.', exc.op, self.id)
try:
coro = DiscordWebSocket.from_client(
self._client,
@@ -377,7 +377,7 @@ class AutoShardedClient(Client):
def get_shard(self, shard_id: int) -> Optional[ShardInfo]:
"""Optional[:class:`ShardInfo`]: Gets the shard information at a given shard ID or ``None`` if not found."""
try:
- _logent = self.__shards[shard_id]
+ parent = self.__shards[shard_id]
except KeyError:
return None
else:
@@ -393,7 +393,7 @@ class AutoShardedClient(Client):
coro = DiscordWebSocket.from_client(self, initial=initial, gateway=gateway, shard_id=shard_id)
ws = await asyncio.wait_for(coro, timeout=180.0)
except Exception:
- log.exception('Failed to connect for shard_id: %s. Retrying...', shard_id)
+ _log.exception('Failed to connect for shard_id: %s. Retrying...', shard_id)
await asyncio.sleep(5.0)
return await self.launch_shard(gateway, shard_id)