Browse Source

Add versionadded to VoiceClient latency and average_latency

pull/5069/head
Tsumiki 5 years ago
committed by GitHub
parent
commit
5cbbbca193
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      discord/voice_client.py

7
discord/voice_client.py

@ -214,13 +214,18 @@ class VoiceClient:
This could be referred to as the Discord Voice WebSocket latency and is This could be referred to as the Discord Voice WebSocket latency and is
an analogue of user's voice latencies as seen in the Discord client. an analogue of user's voice latencies as seen in the Discord client.
.. versionadded:: 1.4
""" """
ws = self.ws ws = self.ws
return float("inf") if not ws else ws.latency return float("inf") if not ws else ws.latency
@property @property
def average_latency(self): def average_latency(self):
""":class:`float`: Average of most recent 20 HEARTBEAT latencies in seconds.""" """:class:`float`: Average of most recent 20 HEARTBEAT latencies in seconds.
.. versionadded:: 1.4
"""
ws = self.ws ws = self.ws
return float("inf") if not ws else ws.average_latency return float("inf") if not ws else ws.average_latency

Loading…
Cancel
Save