Skip to content

Commit 63b4d85

Browse files
committed
protocols
1 parent f231d72 commit 63b4d85

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

discord/voice/_types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@
3434
RawVoiceServerUpdateEvent,
3535
RawVoiceStateUpdateEvent,
3636
)
37+
from discord.voice.client import VoiceClient
3738

3839
ClientT = TypeVar("ClientT", bound="Client", covariant=True)
40+
VoiceClientT = TypeVar('VoiceClientT', bound='VoiceClient', covariant=True)
3941

4042

4143
class VoiceProtocol(Generic[ClientT]):
@@ -157,3 +159,6 @@ def cleanup(self) -> None:
157159
"""
158160
key, _ = self.channel._get_voice_client_key()
159161
self.client._connection._remove_voice_client(key)
162+
163+
164+
class RecorderProtocol(Generic[VoiceClientT]):

discord/voice/recorder.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,14 @@
2525
from __future__ import annotations
2626

2727
# TODO: finish this
28+
29+
30+
class Recorder:
31+
"""Represents a voice recorder for a voice client.
32+
33+
You should not construct this but instead obtain it from :attr:`VoiceClient.recorder`.
34+
35+
.. versionadded:: 2.7
36+
"""
37+
38+
def __init__(self, client: VoiceClient) -> None:

0 commit comments

Comments
 (0)