Skip to content

Commit f952fca

Browse files
authored
Merge branch 'master' into feat/nameplates
Signed-off-by: Paillat <paillat@pycord.dev>
2 parents 3a8ddce + 975a0d9 commit f952fca

File tree

544 files changed

+54096
-12577
lines changed

Some content is hidden

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

544 files changed

+54096
-12577
lines changed

.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.7.1
43+
uses: crowdin/github-action@v2.9.1
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.7.1
47+
uses: crowdin/github-action@v2.9.1
4848
with:
4949
upload_sources: true
5050
upload_translations: false

.github/workflows/todo-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: "Checkout Repository"
2424
uses: actions/checkout@v4
2525
- name: "Track TODO Action"
26-
uses: ribtoks/tdg-github-action@v0.4.14-beta
26+
uses: ribtoks/tdg-github-action@v0.4.15-beta
2727
with:
2828
TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
REPO: ${{ github.repository }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ repos:
8787
args: [--prose-wrap=always, --print-width=88]
8888
exclude: \.(po|pot|yml|yaml)$
8989
- repo: https://github.com/DanielNoord/pydocstringformatter
90-
rev: v0.7.3
90+
rev: v0.7.5
9191
hooks:
9292
- id: pydocstringformatter
9393
exclude: \.(po|pot|yml|yaml)$

CHANGELOG.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,22 @@ These changes are available on the `master` branch, but have not yet been releas
5151
([#2564](https://github.com/Pycord-Development/pycord/pull/2564))
5252
- Added `Message.forward_to`, `Message.snapshots`, and other related attributes.
5353
([#2598](https://github.com/Pycord-Development/pycord/pull/2598))
54+
- Add missing `Guild` feature flags and `Guild.edit` parameters.
55+
([#2672](https://github.com/Pycord-Development/pycord/pull/2672))
5456
- Added the ability to change the API's base URL with `Route.API_BASE_URL`.
5557
([#2714](https://github.com/Pycord-Development/pycord/pull/2714))
5658
- Added the ability to pass a `datetime.time` object to `format_dt`.
5759
([#2747](https://github.com/Pycord-Development/pycord/pull/2747))
60+
- Added support for type hinting slash command options with `typing.Annotated`.
61+
([#2782](https://github.com/Pycord-Development/pycord/pull/2782))
62+
- Added conversion to `Member` in `MentionableConverter`.
63+
([#2775](https://github.com/Pycord-Development/pycord/pull/2775))
5864
- Added `discord.Interaction.created_at`.
5965
([#2801](https://github.com/Pycord-Development/pycord/pull/2801))
6066
- Added `User.nameplate` property.
6167
([#2817](https://github.com/Pycord-Development/pycord/pull/2817))
68+
- Added role gradients support with `Role.colours` and the `RoleColours` class.
69+
([#2818](https://github.com/Pycord-Development/pycord/pull/2818))
6270

6371
### Fixed
6472

@@ -121,6 +129,12 @@ These changes are available on the `master` branch, but have not yet been releas
121129
([#2781](https://github.com/Pycord-Development/pycord/pull/2781))
122130
- Fixed `VoiceClient` crashing randomly while receiving audio
123131
([#2800](https://github.com/Pycord-Development/pycord/pull/2800))
132+
- Fixed `VoiceClient.connect` failing to do initial connection.
133+
([#2812](https://github.com/Pycord-Development/pycord/pull/2812))
134+
- Fixed `AttributeError` when printing a File component's `__repr__`.
135+
([#2843](https://github.com/Pycord-Development/pycord/pull/2843))
136+
- Fixed `TypeError` when using `@option` with certain annotations and along with
137+
`channel_types`. ([#2835](https://github.com/Pycord-Development/pycord/pull/2835))
124138

125139
### Changed
126140

@@ -140,6 +154,8 @@ These changes are available on the `master` branch, but have not yet been releas
140154
([#2564](https://github.com/Pycord-Development/pycord/pull/2564))
141155
- Changed the default value of `ApplicationCommand.nsfw` to `False`.
142156
([#2797](https://github.com/Pycord-Development/pycord/pull/2797))
157+
- Upgraded voice websocket version to v8.
158+
([#2812](https://github.com/Pycord-Development/pycord/pull/2812))
143159

144160
### Deprecated
145161

@@ -152,8 +168,8 @@ These changes are available on the `master` branch, but have not yet been releas
152168

153169
### Removed
154170

155-
- Removed deprecated support for `Option` in `BridgeCommand`. Use `BridgeOption`
156-
instead. ([#2731])(https://github.com/Pycord-Development/pycord/pull/2731))
171+
- Removed deprecated support for `Option` in `BridgeCommand`, use `BridgeOption`
172+
instead. ([#2731](https://github.com/Pycord-Development/pycord/pull/2731))
157173

158174
## [2.6.1] - 2024-09-15
159175

crowdin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ preserve_hierarchy: true
55

66
commit_message: "docs: Update translations"
77

8-
export_languages: ["de", "ja", "fr", "it", "hi", "ko", "pt-BR", "es-ES", "zh-CN"]
8+
export_languages: ["de", "ja", "fr", "it", "hi", "ko", "pt-BR", "es-ES", "zh-CN", "tr"]
99

1010
bundles:
1111
- 1

discord/abc.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,6 +1615,12 @@ async def send(
16151615
)
16161616

16171617
components = view.to_components()
1618+
if view.is_components_v2():
1619+
if embeds or content:
1620+
raise TypeError(
1621+
"cannot send embeds or content with a view using v2 component logic"
1622+
)
1623+
flags.is_components_v2 = True
16181624
else:
16191625
components = None
16201626

@@ -1679,8 +1685,10 @@ async def send(
16791685

16801686
ret = state.create_message(channel=channel, data=data)
16811687
if view:
1682-
state.store_view(view, ret.id)
1688+
if view.is_dispatchable():
1689+
state.store_view(view, ret.id)
16831690
view.message = ret
1691+
view.refresh(ret.components)
16841692

16851693
if delete_after is not None:
16861694
await ret.delete(delay=delete_after)

discord/asset.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ class Asset(AssetMixin):
144144
145145
.. describe:: hash(x)
146146
147-
Returns the hash of the asset.
147+
Returns the asset's url's hash.
148+
149+
This is equivalent to hash(:attr:`url`).
148150
"""
149151

150152
__slots__: tuple[str, ...] = (

discord/bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,15 +884,15 @@ async def process_application_commands(
884884

885885
ctx = await self.get_application_context(interaction)
886886
if command:
887-
ctx.command = command
887+
interaction.command = command
888888
await self.invoke_application_command(ctx)
889889

890890
async def on_application_command_auto_complete(
891891
self, interaction: Interaction, command: ApplicationCommand
892892
) -> None:
893893
async def callback() -> None:
894894
ctx = await self.get_autocomplete_context(interaction)
895-
ctx.command = command
895+
interaction.command = command
896896
return await command.invoke_autocomplete_callback(ctx)
897897

898898
autocomplete_task = self._bot.loop.create_task(callback())

discord/channel.py

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,16 @@
2626
from __future__ import annotations
2727

2828
import datetime
29-
from typing import TYPE_CHECKING, Any, Callable, Iterable, Mapping, TypeVar, overload
29+
from typing import (
30+
TYPE_CHECKING,
31+
Any,
32+
Callable,
33+
Iterable,
34+
Mapping,
35+
Sequence,
36+
TypeVar,
37+
overload,
38+
)
3039

3140
import discord.abc
3241

@@ -45,7 +54,7 @@
4554
)
4655
from .errors import ClientException, InvalidArgument
4756
from .file import File
48-
from .flags import ChannelFlags
57+
from .flags import ChannelFlags, MessageFlags
4958
from .invite import Invite
5059
from .iterators import ArchivedThreadIterator
5160
from .mixins import Hashable
@@ -71,12 +80,15 @@
7180

7281
if TYPE_CHECKING:
7382
from .abc import Snowflake, SnowflakeTime
83+
from .embeds import Embed
7484
from .guild import Guild
7585
from .guild import GuildChannel as GuildChannelType
7686
from .member import Member, VoiceState
87+
from .mentions import AllowedMentions
7788
from .message import EmojiInputType, Message, PartialMessage
7889
from .role import Role
7990
from .state import ConnectionState
91+
from .sticker import GuildSticker, StickerItem
8092
from .types.channel import CategoryChannel as CategoryChannelPayload
8193
from .types.channel import DMChannel as DMChannelPayload
8294
from .types.channel import ForumChannel as ForumChannelPayload
@@ -87,6 +99,7 @@
8799
from .types.channel import VoiceChannel as VoiceChannelPayload
88100
from .types.snowflake import SnowflakeList
89101
from .types.threads import ThreadArchiveDuration
102+
from .ui.view import View
90103
from .user import BaseUser, ClientUser, User
91104
from .webhook import Webhook
92105

@@ -1181,18 +1194,20 @@ async def edit(self, *, reason=None, **options):
11811194
async def create_thread(
11821195
self,
11831196
name: str,
1184-
content=None,
1197+
content: str | None = None,
11851198
*,
1186-
embed=None,
1187-
embeds=None,
1188-
file=None,
1189-
files=None,
1190-
stickers=None,
1191-
delete_message_after=None,
1192-
nonce=None,
1193-
allowed_mentions=None,
1194-
view=None,
1195-
applied_tags=None,
1199+
embed: Embed | None = None,
1200+
embeds: list[Embed] | None = None,
1201+
file: File | None = None,
1202+
files: list[File] | None = None,
1203+
stickers: Sequence[GuildSticker | StickerItem] | None = None,
1204+
delete_message_after: float | None = None,
1205+
nonce: int | str | None = None,
1206+
allowed_mentions: AllowedMentions | None = None,
1207+
view: View | None = None,
1208+
applied_tags: list[ForumTag] | None = None,
1209+
suppress: bool = False,
1210+
silent: bool = False,
11961211
auto_archive_duration: ThreadArchiveDuration = MISSING,
11971212
slowmode_delay: int = MISSING,
11981213
reason: str | None = None,
@@ -1292,13 +1307,24 @@ async def create_thread(
12921307
else:
12931308
allowed_mentions = allowed_mentions.to_dict()
12941309

1310+
flags = MessageFlags(
1311+
suppress_embeds=bool(suppress),
1312+
suppress_notifications=bool(silent),
1313+
)
1314+
12951315
if view:
12961316
if not hasattr(view, "__discord_ui_view__"):
12971317
raise InvalidArgument(
12981318
f"view parameter must be View not {view.__class__!r}"
12991319
)
13001320

13011321
components = view.to_components()
1322+
if view.is_components_v2():
1323+
if embeds or content:
1324+
raise TypeError(
1325+
"cannot send embeds or content with a view using v2 component logic"
1326+
)
1327+
flags.is_components_v2 = True
13021328
else:
13031329
components = None
13041330

@@ -1337,6 +1363,7 @@ async def create_thread(
13371363
or self.default_auto_archive_duration,
13381364
rate_limit_per_user=slowmode_delay or self.slowmode_delay,
13391365
applied_tags=applied_tags,
1366+
flags=flags.value,
13401367
reason=reason,
13411368
)
13421369
finally:
@@ -1346,7 +1373,7 @@ async def create_thread(
13461373

13471374
ret = Thread(guild=self.guild, state=self._state, data=data)
13481375
msg = ret.get_partial_message(int(data["last_message_id"]))
1349-
if view:
1376+
if view and view.is_dispatchable():
13501377
state.store_view(view, msg.id)
13511378

13521379
if delete_message_after is not None:

0 commit comments

Comments
 (0)