Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ docs/crowdin.py
*.mp3
*.m4a
*.wav
*.mp4
*.ogg
*.pcm
*.png
*.jpg
*.flac
*.mo
Expand All @@ -19,7 +23,11 @@ env/
.DS_Store
.python-version
__pycache__
.vs/*
.vscode/*
env/
build/
node_modules/*
test.py
*.png
build/
node_modules/*
test.py
4 changes: 2 additions & 2 deletions discord/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
__author__ = 'Pycord Development'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015-2021 Rapptz & Copyright 2021-present Pycord Development'
__version__ = '2.0.0b'
__version__ = '2.0.0b1'

__path__ = __import__('pkgutil').extend_path(__path__, __name__)

import logging
from typing import NamedTuple, Literal

from . import utils, opus, abc, ui
from . import utils, opus, abc, ui, sinks
from .activity import *
from .appinfo import *
from .asset import *
Expand Down
1 change: 0 additions & 1 deletion discord/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ def __init__(self, shard_id: Optional[int]):
)
super().__init__(msg % shard_id)


class InteractionResponded(ClientException):
"""Exception that's raised when sending another interaction response using
:class:`InteractionResponse` when one has already been done before.
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