Skip to content

Commit 90ce912

Browse files
committed
Merge branch 'fix-auto-sync' of https://github.com/Icebluewolf/pycord into fix-auto-sync
2 parents aa292c8 + a424cba commit 90ce912

79 files changed

Lines changed: 6143 additions & 1987 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Install dependencies
4848
run: |
4949
python -m pip install -U pip
50-
pip install ".[docs]"
50+
pip install ".[docs,voice]"
5151
- name: "Check Links"
5252
if: ${{ github.event_name == 'schedule' || inputs.with_linkcheck }}
5353
run: |

.github/workflows/docs-json-export.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
id: install-deps
2727
run: |
2828
python -m pip install -U pip
29-
pip install ".[docs]"
29+
pip install ".[docs,voice]"
3030
pip install beautifulsoup4
3131
- name: Build Sphinx HTML docs
3232
id: build-sphinx

.github/workflows/docs-localization-download.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
working-directory: ./docs
4141
- name: "Crowdin"
4242
id: crowdin
43-
uses: crowdin/github-action@v2.15.0
43+
uses: crowdin/github-action@v2.15.2
4444
with:
4545
upload_sources: false
4646
upload_translations: false

.github/workflows/docs-localization-upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
sphinx-intl update -p ./build/locales ${{ vars.SPHINX_LANGUAGES }}
4545
working-directory: ./docs
4646
- name: "Crowdin"
47-
uses: crowdin/github-action@v2.15.0
47+
uses: crowdin/github-action@v2.15.2
4848
with:
4949
upload_sources: true
5050
upload_translations: false

.github/workflows/lib-checks.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- "*.toml"
99
- "*.py"
1010
- ".*"
11-
branches: [master]
11+
branches: [ master ]
1212
pull_request:
1313
paths:
1414
- "discord/**"
@@ -140,29 +140,30 @@ jobs:
140140
runs-on: ${{ matrix.os }}
141141
strategy:
142142
matrix:
143-
os: [ubuntu-latest, windows-latest, macos-latest]
144-
python-version: ["3.10", "3.11", "3.12", "3.13"]
143+
os: [ ubuntu-latest, windows-latest, macos-latest ]
144+
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
145145
steps:
146146
- name: "Checkout Repository"
147147
uses: actions/checkout@v6
148148

149149
- name: "Setup Python"
150150
uses: actions/setup-python@v6
151151
with:
152-
python-version: "3.13"
152+
python-version: ${{ matrix.python-version }}
153153
cache: "pip"
154154
cache-dependency-path: "pyproject.toml"
155155

156156
- name: "Install dependencies"
157157
run: |
158158
python -m pip install --upgrade pip
159159
pip install . --group dev
160+
pip install .[voice]
160161
161162
- name: "Run tests"
162163
run: tox
163164
tests-pass: # ref: https://github.com/orgs/community/discussions/4324#discussioncomment-3477871
164165
runs-on: ubuntu-latest
165-
needs: [tests]
166+
needs: [ tests ]
166167
if: always() && github.event_name != 'schedule'
167168
steps:
168169
- name: Tests succeeded

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ jobs:
215215
python3 -m build --sdist
216216
python3 -m build --wheel
217217
- name: "Create GitHub Release"
218-
uses: softprops/action-gh-release@v2.5.0
218+
uses: softprops/action-gh-release@v2.6.1
219219
id: gh-release
220220
with:
221221
tag_name: "v${{ inputs.version }}"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ repos:
3131
- id: isort
3232
exclude: \.(po|pot|yml|yaml)$
3333
- repo: https://github.com/psf/black-pre-commit-mirror
34-
rev: 26.1.0
34+
rev: 26.3.1
3535
hooks:
3636
- id: black
3737
args: [--safe, --quiet]

.readthedocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ python:
1717
path: .
1818
extra_requirements:
1919
- docs
20+
- voice

CHANGELOG.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ These changes are available on the `master` branch, but have not yet been releas
1616
([#3044](https://github.com/Pycord-Development/pycord/pull/3044))
1717
- Added `Member.colours` and `Member.colors` properties.
1818
([#3063](https://github.com/Pycord-Development/pycord/pull/3063))
19+
- Added `RoleType` enum accessible via `Role.type` and `RoleTags.type`.
20+
([#2708](https://github.com/Pycord-Development/pycord/pull/2708))
21+
- Added `Colour.light_theme()`, `Colour.ash_theme()`, and `Colour.onyx_theme()`.
22+
([#3043](https://github.com/Pycord-Development/pycord/pull/3043))
1923
- Added `RadioGroup`, `CheckboxGroup`, and `Checkbox` for modals.
2024
([#3073](https://github.com/Pycord-Development/pycord/pull/3073))
2125
- Added the ability to respond to interactions with suppressed push and desktop
@@ -26,11 +30,18 @@ These changes are available on the `master` branch, but have not yet been releas
2630
([#3107](https://github.com/Pycord-Development/pycord/pull/3107))
2731
- Added `Member.display_avatar_decoration` and `Member.guild_avatar_decoration`.
2832
([#3109](https://github.com/Pycord-Development/pycord/pull/3109))
33+
- Added a new event called `on_raw_member_update` that is dispatched when a member is
34+
updated, regardless of cache status.
35+
([#3012](https://github.com/Pycord-Development/pycord/pull/3012))
36+
- Added support for Discord DAVE (Audio & Video E2EE) for voice-sending related
37+
features. ([#3143](https://github.com/Pycord-Development/pycord/pull/3143))
2938

3039
### Changed
3140

3241
- Changed `Member.colour` and `Member.color` to be aliases for `Member.colours.primary`.
3342
([#3063](https://github.com/Pycord-Development/pycord/pull/3063))
43+
- Updated `Colour.dark_theme()` with Discord's new theme colours.
44+
([#3043](https://github.com/Pycord-Development/pycord/pull/3043))
3445
- Changed `User.nameplate` to be an alias for `User.collectibles.nameplate`.
3546
([#3107](https://github.com/Pycord-Development/pycord/pull/3107))
3647
- Changed `FileComponent.name` and `FileComponent.size` to be optional.
@@ -49,9 +60,18 @@ These changes are available on the `master` branch, but have not yet been releas
4960

5061
### Deprecated
5162

63+
- Deprecated `is_bot_managed`, `is_premium_subscriber`, `is_integration`,
64+
`is_available_for_purchase`, and `is_guild_connections_role` in favor of `type` for
65+
both `Role` and `RoleTags` .
66+
([#2708](https://github.com/Pycord-Development/pycord/pull/2708))
67+
- Deprecated `Colour.embed_background()`.
68+
([#3043](https://github.com/Pycord-Development/pycord/pull/3043))
5269
- Deprecated the `suppress` parameter in all applicable message-related methods in favor
5370
of `suppress_embeds`.
5471
([#3062](https://github.com/Pycord-Development/pycord/pull/3062))
72+
- Deprecated `discord.VoiceClient` and `discord.VoiceProtocol` in favor of
73+
`discord.voice.VoiceClient` and `discord.voice.VoiceProtocol`.
74+
([#3143](https://github.com/Pycord-Development/pycord/pull/3143))
5575

5676
### Removed
5777

@@ -1075,24 +1095,23 @@ These changes are available on the `master` branch, but have not yet been releas
10751095
- Fixed `AttributeError` when serializing commands with `Annotated` type hints.
10761096
([#2243](https://github.com/Pycord-Development/pycord/pull/2243))
10771097
- Fixed `Intents.all()` returning the wrong value.
1078-
([#2257](https://github.com/Pycord-Development/pycord/issues/2257))
1098+
([#2257](https://github.com/Pycord-Development/pycord/pull/2257))
10791099
- Fixed `AuditLogIterator` not respecting the `after` parameter.
1080-
([#2295](https://github.com/Pycord-Development/pycord/issues/2295))
1100+
([#2295](https://github.com/Pycord-Development/pycord/pull/2295))
10811101
- Fixed `AttributeError` when failing to establish initial websocket connection.
10821102
([#2301](https://github.com/Pycord-Development/pycord/pull/2301))
10831103
- Fixed `AttributeError` caused by `command.cog` being `MISSING`.
1084-
([#2303](https://github.com/Pycord-Development/pycord/issues/2303))
1104+
([#2303](https://github.com/Pycord-Development/pycord/pull/2303))
10851105
- Fixed `self.use_default_buttons` being assumed truthy by `Paginator.update`.
10861106
([#2319](https://github.com/Pycord-Development/pycord/pull/2319))
10871107
- Fixed `AttributeError` when comparing application commands with non-command objects.
1088-
([#2299](https://github.com/Pycord-Development/pycord/issues/2299))
1108+
([#2299](https://github.com/Pycord-Development/pycord/pull/2299))
10891109
- Fixed `AttributeError` when copying groups on startup.
1090-
([#2331](https://github.com/Pycord-Development/pycord/issues/2331))
1110+
([#2331](https://github.com/Pycord-Development/pycord/pull/2331))
10911111
- Fixed application command options causing errors if declared through the option
1092-
decorator or kwarg.
1093-
([#2332](https://github.com/Pycord-Development/pycord/issues/2332))
1112+
decorator or kwarg. ([#2332](https://github.com/Pycord-Development/pycord/pull/2332))
10941113
- Fixed options declared using the parameter default value syntax always being optional.
1095-
([#2333](https://github.com/Pycord-Development/pycord/issues/2333))
1114+
([#2333](https://github.com/Pycord-Development/pycord/pull/2333))
10961115
- Fixed `BridgeContext` type hints raising an exception for unsupported option type.
10971116
([#2337](https://github.com/Pycord-Development/pycord/pull/2337))
10981117
- Fixed `TypeError` due to `(Sync)WebhookMessage._thread_id` being set to `None`.

discord/__init__.py

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1717

1818
import logging
19+
from typing import TYPE_CHECKING
1920

2021
# We need __version__ to be imported first
2122
# isort: off
@@ -74,9 +75,51 @@
7475
from .template import *
7576
from .threads import *
7677
from .user import *
77-
from .voice_client import *
7878
from .webhook import *
7979
from .welcome_screen import *
8080
from .widget import *
8181

82+
if TYPE_CHECKING:
83+
from typing import Generic, TypeVar
84+
85+
from typing_extensions import deprecated
86+
87+
from discord.voice import VoiceClient as VoiceClientC
88+
from discord.voice import VoiceProtocol as VoiceProtocolC
89+
90+
from .client import Client
91+
92+
C = TypeVar("C", bound=Client)
93+
94+
@deprecated(
95+
"discord.VoiceClient is deprecated in favour of discord.voice.VoiceClient since 2.7 and will be removed in 3.0",
96+
)
97+
class VoiceClient(VoiceClientC): ...
98+
99+
@deprecated(
100+
"discord.VoiceProtocol is deprecated in favour of discord.voice.VoiceProtocol since 2.7 and will be removed in 3.0",
101+
)
102+
class VoiceProtocol(VoiceProtocolC[C], Generic[C]): ...
103+
104+
else:
105+
from .utils import warn_deprecated
106+
107+
def __getattr__(name: str) -> object:
108+
if name == "VoiceClient":
109+
warn_deprecated(
110+
"discord.VoiceClient", "discord.voice.VoiceClient", "2.7", "3.0"
111+
)
112+
from .voice import VoiceClient
113+
114+
return VoiceClient
115+
if name == "VoiceProtocol":
116+
warn_deprecated(
117+
"discord.VoiceProtocol", "discord.voice.VoiceProtocol", "2.7", "3.0"
118+
)
119+
from .voice import VoiceProtocol
120+
121+
return VoiceProtocol
122+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
123+
124+
82125
logging.getLogger(__name__).addHandler(logging.NullHandler())

0 commit comments

Comments
 (0)