mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +00:00
Type up **kwargs of various methods
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user