Skip to content

Commit

Permalink
Merge branch 'Pycord-Development:master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunkLightTuna authored Jan 21, 2024
2 parents 6fee7e2 + 122cf46 commit ec4a64f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
pip install -r requirements/dev.txt
- name: Setup cache
id: cache-pylint
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .pylint.d
key: pylint
Expand All @@ -43,7 +43,7 @@ jobs:
pip install -r requirements/dev.txt
- name: Setup cache
id: cache-mypy
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .mypy_cache
key: mypy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
pip install -r requirements/dev.txt
- name: Setup cache
id: cache-pytest
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .pytest_cache
key: ${{ matrix.os }}-${{ matrix.python-version }}-pytest
Expand Down
26 changes: 23 additions & 3 deletions discord/voice_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import struct
import threading
import time
from typing import TYPE_CHECKING, Any, Callable
from typing import TYPE_CHECKING, Any, Callable, Literal, overload

from . import opus, utils
from .backoff import ExponentialBackoff
Expand Down Expand Up @@ -623,13 +623,33 @@ def get_ssrc(self, user_id):
user_id
]

@overload
def play(
self,
source: AudioSource,
*,
after: Callable[[Exception | None], Any] = None,
wait_finish: bool = False,
after: Callable[[Exception | None], Any] | None = None,
wait_finish: Literal[False] = False,
) -> None:
...

@overload
def play(
self,
source: AudioSource,
*,
after: Callable[[Exception | None], Any] | None = None,
wait_finish: Literal[True],
) -> asyncio.Future:
...

def play(
self,
source: AudioSource,
*,
after: Callable[[Exception | None], Any] | None = None,
wait_finish: bool = False,
) -> None | asyncio.Future:
"""Plays an :class:`AudioSource`.
The finalizer, ``after`` is called after the source has been exhausted
Expand Down
2 changes: 1 addition & 1 deletion requirements/_.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
aiohttp>=3.6.0,<3.10.0
aiohttp>=3.6.0,<4.0
typing_extensions>=4,<5; python_version < "3.11"
6 changes: 3 additions & 3 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
-r _.txt
pylint~=3.0.3
pytest~=7.4.3
pytest-asyncio~=0.23.2
pytest~=7.4.4
pytest-asyncio~=0.23.3
# pytest-order~=1.0.1
mypy~=1.8.0
coverage~=7.4
pre-commit==3.5.0
codespell==2.2.6
bandit==1.7.6
flake8==6.1.0
flake8==7.0.0

0 comments on commit ec4a64f

Please sign in to comment.