Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1d60c90
Implementation Of https://github.com/Rapptz/discord.py/pull/6507
VincentRPS Nov 30, 2021
03af470
Merge branch 'Pycord-Development:master' into support/voice/recording
VincentRPS Dec 1, 2021
a4b9572
Implement Fix
VincentRPS Dec 2, 2021
b3e5676
Advances Docstrings in sink
VincentRPS Dec 2, 2021
5942029
Implement Fixes
VincentRPS Dec 2, 2021
02b1224
Should Decrease Static By A Bit
VincentRPS Dec 2, 2021
1477787
Fixes & Docs
VincentRPS Dec 2, 2021
b2ce9d8
Fix
VincentRPS Dec 2, 2021
9c0da12
Fix Indents
VincentRPS Dec 2, 2021
913874f
Switch Example To Use MP3
VincentRPS Dec 3, 2021
484af09
Adding PCM As Ignored
VincentRPS Dec 3, 2021
5f54f73
Fixes
VincentRPS Dec 3, 2021
86e0417
Fix Static Error
VincentRPS Dec 6, 2021
7503d06
Fix RecordingException Docs
VincentRPS Dec 6, 2021
052bf5c
Fix ValueErrors
VincentRPS Dec 6, 2021
a40280f
Merge branch 'Pycord-Development:master' into support/voice/recording
VincentRPS Dec 6, 2021
5474912
Changing Version Added To 2.0
VincentRPS Dec 6, 2021
fc22bfa
Merge branch 'support/voice/recording' of https://github.com/pycord/p…
VincentRPS Dec 6, 2021
f86b743
Details
VincentRPS Dec 6, 2021
27ce915
Fix My Visual Studio Setup
VincentRPS Dec 9, 2021
2ffca1e
Typo
VincentRPS Dec 9, 2021
5a5a2cf
Better Filters Docstring
VincentRPS Dec 9, 2021
b89bfb8
Fix
VincentRPS Dec 9, 2021
6b9c516
Fix Version Info
VincentRPS Dec 9, 2021
c1cf566
Fix
VincentRPS Dec 10, 2021
c315533
Merge branch 'Pycord-Development:master' into support/voice/recording
VincentRPS Dec 15, 2021
d14c37b
Merge branch 'Pycord-Development:master' into support/voice/recording
VincentRPS Dec 18, 2021
dc63620
Redo Voice Example To Use Bot Instead of Client
VincentRPS Dec 19, 2021
65c8dfb
Fix Typo
VincentRPS Dec 19, 2021
db37b9c
Replace `ClientException`s to `SinkException`s
VincentRPS Dec 19, 2021
a7c24da
Adding ``.pycord`` tempdir
VincentRPS Dec 19, 2021
d8d6313
revert tempdir
VincentRPS Dec 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ docs/crowdin.py
*.mp3
*.m4a
*.wav
*.pcm
*.png
*.jpg
*.flac
Expand All @@ -18,6 +19,8 @@ docs/crowdin.py
.DS_Store
.python-version
__pycache__
.vs/slnx.sqlite
.vs/*
.vscode/*
env/
build/
test.py
1 change: 1 addition & 0 deletions discord/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
from .sticker import *
from .stage_instance import *
from .interactions import *
from .sink import *
from .components import *
from .threads import *
from .bot import *
Expand Down
16 changes: 15 additions & 1 deletion discord/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
'ExtensionNotLoaded',
'NoEntryPointError',
'ExtensionFailed',
'ExtensionNotFound'
'ExtensionNotFound',
'RecordingException',
)


Expand Down Expand Up @@ -269,6 +270,19 @@ def __init__(self, shard_id: Optional[int]):
)
super().__init__(msg % shard_id)

class RecordingException(ClientException):
"""Exception that's thrown when there is an error while trying to record
audio from a voice channel.

.. versionadded:: 2.0
"""
pass

class SinkException(ClientException):
"""Raised when a Sink error occurs.

.. versionadded:: 2.0
"""

class InteractionResponded(ClientException):
"""Exception that's raised when sending another interaction response using
Expand Down
10 changes: 10 additions & 0 deletions discord/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ def __init__(self, socket, loop, *, hook=None):
self._keep_alive = None
self._close_code = None
self.secret_key = None
self.ssrc_map = {}
if hook:
self._hook = hook

Expand Down Expand Up @@ -839,6 +840,15 @@ async def received_message(self, msg):
self._keep_alive = VoiceKeepAliveHandler(ws=self, interval=min(interval, 5.0))
self._keep_alive.start()

elif op == self.SPEAKING:
ssrc = data['ssrc']
user = int(data['user_id'])
speaking = data['speaking']
if ssrc in self.ssrc_map:
self.ssrc_map[ssrc]['speaking'] = speaking
else:
self.ssrc_map.update({ssrc: {'user_id': user, 'speaking': speaking}})

await self._hook(self, msg)

async def initial_connection(self, data):
Expand Down
Loading