26
26
from __future__ import annotations
27
27
28
28
from collections .abc import Awaitable , Callable
29
- from typing import TYPE_CHECKING , Any , Generic , TypeVar , Union
29
+ from typing import TYPE_CHECKING , Generic , TypeVar , Union
30
30
31
31
if TYPE_CHECKING :
32
32
from typing_extensions import ParamSpec
39
39
)
40
40
from discord .sinks import Sink
41
41
42
- P = ParamSpec ('P' )
43
- R = TypeVar ('R' )
42
+ P = ParamSpec ("P" )
43
+ R = TypeVar ("R" )
44
44
RecordCallback = Union [Callable [P , R ], Callable [P , Awaitable [R ]]]
45
45
46
46
ClientT = TypeVar ("ClientT" , bound = "Client" , covariant = True )
47
- VoiceProtocolT = TypeVar (' VoiceProtocolT' , bound = ' VoiceProtocol' , covariant = True )
47
+ VoiceProtocolT = TypeVar (" VoiceProtocolT" , bound = " VoiceProtocol" , covariant = True )
48
48
49
49
50
50
class VoiceProtocol (Generic [ClientT ]):
@@ -195,7 +195,9 @@ class VoiceRecorderProtocol(Generic[VoiceProtocolT]):
195
195
:attr:`VoiceProtocol.channel`
196
196
"""
197
197
198
- def __init__ (self , client : VoiceProtocolT , channel : abc .Connectable | None = None ) -> None :
198
+ def __init__ (
199
+ self , client : VoiceProtocolT , channel : abc .Connectable | None = None
200
+ ) -> None :
199
201
self .client : VoiceProtocolT = client
200
202
self .channel : abc .Connectable = channel or client .channel
201
203
@@ -212,7 +214,7 @@ def get_ssrc(self, user_id: int) -> int:
212
214
:class:`int`
213
215
The ssrc for the provided user ID.
214
216
"""
215
- raise NotImplementedError (' subclasses must implement this' )
217
+ raise NotImplementedError (" subclasses must implement this" )
216
218
217
219
def unpack (self , data : bytes ) -> bytes | None :
218
220
"""Takes an audio packet received from Discord and decodes it.
@@ -227,7 +229,7 @@ def unpack(self, data: bytes) -> bytes | None:
227
229
Optional[:class:`bytes`]
228
230
The unpacked bytes, or ``None`` if they could not be unpacked.
229
231
"""
230
- raise NotImplementedError (' subclasses must implement this' )
232
+ raise NotImplementedError (" subclasses must implement this" )
231
233
232
234
def record (
233
235
self ,
@@ -259,8 +261,8 @@ def record(
259
261
TypeError
260
262
You did not pass a Sink object.
261
263
"""
262
- raise NotImplementedError (' subclasses must implement this' )
264
+ raise NotImplementedError (" subclasses must implement this" )
263
265
264
266
def stop (self ) -> None :
265
267
"""Stops recording."""
266
- raise NotImplementedError (' subclasses must implement this' )
268
+ raise NotImplementedError (" subclasses must implement this" )
0 commit comments