From 99ce620ae2603b24975e6865267e2df4ea30ad1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Jan 2024 06:21:06 +0000 Subject: [PATCH 1/4] chore(deps-dev): bump flake8 from 6.1.0 to 7.0.0 (#2311) Bumps [flake8](https://github.com/pycqa/flake8) from 6.1.0 to 7.0.0. - [Commits](https://github.com/pycqa/flake8/compare/6.1.0...7.0.0) --- updated-dependencies: - dependency-name: flake8 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 4aede160f1..7ab9f0f44a 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -8,4 +8,4 @@ coverage~=7.4 pre-commit==3.5.0 codespell==2.2.6 bandit==1.7.6 -flake8==6.1.0 +flake8==7.0.0 From 623658744aec81ce4ad7ca47ab1cc10a8f9cdf2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Jan 2024 06:29:39 +0000 Subject: [PATCH 2/4] chore(deps-dev): update pytest-asyncio requirement from ~=0.23.2 to ~=0.23.3 (#2308) chore(deps-dev): update pytest-asyncio requirement Updates the requirements on [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) to permit the latest version. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.23.2...v0.23.3) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 7ab9f0f44a..4be6c2d96a 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,7 +1,7 @@ -r _.txt pylint~=3.0.3 pytest~=7.4.3 -pytest-asyncio~=0.23.2 +pytest-asyncio~=0.23.3 # pytest-order~=1.0.1 mypy~=1.8.0 coverage~=7.4 From e0f9b10239919bf76d40e253e01e18373bc0475a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Jan 2024 06:42:38 +0000 Subject: [PATCH 3/4] chore(deps-dev): update pytest requirement from ~=7.4.3 to ~=7.4.4 (#2307) Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.4.3...7.4.4) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development ... Signed-off-by: dependabot[bot] Signed-off-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 4be6c2d96a..537bfcd6fc 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,6 +1,6 @@ -r _.txt pylint~=3.0.3 -pytest~=7.4.3 +pytest~=7.4.4 pytest-asyncio~=0.23.3 # pytest-order~=1.0.1 mypy~=1.8.0 From 0cd9ac96f0fb01abac202c0d46b35d88fa64164f Mon Sep 17 00:00:00 2001 From: Krutyi-4el <60041069+Krutyi-4el@users.noreply.github.com> Date: Sun, 21 Jan 2024 08:47:01 +0200 Subject: [PATCH 4/4] fix(typing): proper VoiceClient.play() return value (#2324) * fix(typing): proper VoiceClient.play() return value * style(pre-commit): auto fixes from pre-commit.com hooks * fix(typing): mark after as optional Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Signed-off-by: Krutyi-4el <60041069+Krutyi-4el@users.noreply.github.com> * fix(typing): mark after as optional Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Signed-off-by: Krutyi-4el <60041069+Krutyi-4el@users.noreply.github.com> * fix(typing): mark after as optional Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Signed-off-by: Krutyi-4el <60041069+Krutyi-4el@users.noreply.github.com> --------- Signed-off-by: Krutyi-4el <60041069+Krutyi-4el@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> --- discord/voice_client.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/discord/voice_client.py b/discord/voice_client.py index 437311122a..61bc0ad9d2 100644 --- a/discord/voice_client.py +++ b/discord/voice_client.py @@ -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 @@ -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