aboutsummaryrefslogtreecommitdiff
path: root/discord/voice_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'discord/voice_client.py')
-rw-r--r--discord/voice_client.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/discord/voice_client.py b/discord/voice_client.py
index 246ed7b6..2ae2a8b1 100644
--- a/discord/voice_client.py
+++ b/discord/voice_client.py
@@ -42,6 +42,7 @@ import socket
import logging
import struct
import threading
+from typing import Any, Callable
from . import opus, utils
from .backoff import ExponentialBackoff
@@ -121,7 +122,7 @@ class VoiceProtocol:
"""
raise NotImplementedError
- async def connect(self, *, timeout, reconnect):
+ async def connect(self, *, timeout: float, reconnect: bool):
"""|coro|
An abstract method called when the client initiates the connection request.
@@ -144,7 +145,7 @@ class VoiceProtocol:
"""
raise NotImplementedError
- async def disconnect(self, *, force):
+ async def disconnect(self, *, force: bool):
"""|coro|
An abstract method called when the client terminates the connection.
@@ -328,7 +329,7 @@ class VoiceClient(VoiceProtocol):
self._connected.set()
return ws
- async def connect(self, *, reconnect, timeout):
+ async def connect(self, *, reconnect: bool, timeout: bool):
log.info('Connecting to voice...')
self.timeout = timeout
@@ -451,7 +452,7 @@ class VoiceClient(VoiceProtocol):
log.warning('Could not connect to voice... Retrying...')
continue
- async def disconnect(self, *, force=False):
+ async def disconnect(self, *, force: bool = False):
"""|coro|
Disconnects this voice client from voice.
@@ -525,7 +526,7 @@ class VoiceClient(VoiceProtocol):
return header + box.encrypt(bytes(data), bytes(nonce)).ciphertext + nonce[:4]
- def play(self, source, *, after=None):
+ def play(self, source: AudioSource, *, after: Callable[[Exception], Any]=None):
"""Plays an :class:`AudioSource`.
The finalizer, ``after`` is called after the source has been exhausted