diff --git a/discord/shard.py b/discord/shard.py index f7f230db8..32d448cc3 100644 --- a/discord/shard.py +++ b/discord/shard.py @@ -175,8 +175,10 @@ class AutoShardedClient(Client): This operates similarly to :meth:`.Client.latency` except it uses the average latency of every shard's latency. To get a list of shard latency, check the - :attr:`latencies` property. + :attr:`latencies` property. Returns ``nan`` if there are no shards ready. """ + if not self.shards: + return float('nan') return sum(latency for _, latency in self.latencies) / len(self.shards) @property