From 2a6f1067d764398a6aa20e945bec28ba9e53163a Mon Sep 17 00:00:00 2001 From: grey-cat-1908 Date: Sat, 12 Mar 2022 16:30:04 +0300 Subject: [PATCH] some docstrings and shard latency property --- melisa/models/app/shard.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/melisa/models/app/shard.py b/melisa/models/app/shard.py index a725390..85475dc 100644 --- a/melisa/models/app/shard.py +++ b/melisa/models/app/shard.py @@ -25,11 +25,16 @@ class Shard: """Id of Shard""" return self._gateway.shard_id - # @property - # def + @property + def latency(self) -> float: + """:class:`float`: + Measures latency between a HEARTBEAT command and a HEARTBEAT_ACK event in seconds for this shard""" + return self._gateway.latency async def launch(self, **kwargs) -> Shard: - """Launches new shard""" + """|coro| + + Launches new shard""" self._gateway = Gateway(self._client, self._shard_id, self._num_shards, @@ -51,6 +56,8 @@ class Shard: async def update_presence(self, activity: BotActivity = None, status: str = None) -> Shard: """ + |coro| + Update Presence for the shard Parameters @@ -66,11 +73,16 @@ class Shard: return self async def disconnect(self) -> None: - """Disconnect current shard""" + """ + |coro| + + Disconnect current shard""" await self._try_close() async def reconnect(self, wait_time: int = 3) -> None: - """Reconnect current shard + """|coro| + + Reconnect current shard Parameters ----------