Skip to content

Commit 8ee94ae

Browse files
authored
Merge branch 'master' into with-response
Signed-off-by: Ice Wolfy <[email protected]>
2 parents 25823fd + a5b70e6 commit 8ee94ae

File tree

486 files changed

+15783
-6918
lines changed

Some content is hidden

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

486 files changed

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

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repos:
2626
- id: pyupgrade
2727
exclude: \.(po|pot|yml|yaml)$
2828
- repo: https://github.com/PyCQA/isort
29-
rev: 6.0.0
29+
rev: 6.0.1
3030
hooks:
3131
- id: isort
3232
exclude: \.(po|pot|yml|yaml)$

CHANGELOG.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,14 @@ These changes are available on the `master` branch, but have not yet been releas
4949
([#2579](https://github.com/Pycord-Development/pycord/pull/2579))
5050
- Added new `Subscription` object and related methods/events.
5151
([#2564](https://github.com/Pycord-Development/pycord/pull/2564))
52-
- Implemented `with_response` for interaction callbacks, adding
53-
`Interaction.is_loading()` and `Interaction.is_ephemeral()`.
52+
- Added `Message.forward_to`, `Message.snapshots`, and other related attributes.
53+
([#2598](https://github.com/Pycord-Development/pycord/pull/2598))
54+
- Added the ability to change the API's base URL with `Route.API_BASE_URL`.
55+
([#2714](https://github.com/Pycord-Development/pycord/pull/2714))
56+
- Added the ability to pass a `datetime.time` object to `format_dt`
57+
([#2747](https://github.com/Pycord-Development/pycord/pull/2747))
58+
- Implemented `with_response` for interaction callbacks, adding
59+
`Interaction.callback.is_loading()` and `Interaction.callback.is_ephemeral()`.
5460
([#2711](https://github.com/Pycord-Development/pycord/pull/2711))
5561

5662
### Fixed
@@ -98,6 +104,16 @@ These changes are available on the `master` branch, but have not yet been releas
98104
([#2564](https://github.com/Pycord-Development/pycord/pull/2564))
99105
- Fixed `Subscription.renewal_sku_ids` not accepting `None` from the received payload.
100106
([#2709](https://github.com/Pycord-Development/pycord/pull/2709))
107+
- Fixed `ForumChannel.edit` allowing `default_reaction_emoji` to be `None`.
108+
([#2739](https://github.com/Pycord-Development/pycord/pull/2739))
109+
- Fixed missing `None` type hints in `Select.__init__`.
110+
([#2746](https://github.com/Pycord-Development/pycord/pull/2746))
111+
- Updated `valid_locales` to support `in` and `es-419`.
112+
([#2767](https://github.com/Pycord-Development/pycord/pull/2767))
113+
- Fixed `Webhook.edit` not working with `attachments=[]`.
114+
([#2779](https://github.com/Pycord-Development/pycord/pull/2779))
115+
- Fixed GIF-based `Sticker` returning the wrong `url`.
116+
([#2781](https://github.com/Pycord-Development/pycord/pull/2781))
101117

102118
### Changed
103119

discord/abc.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,17 @@ async def _edit(
521521
)
522522
elif isinstance(default_reaction_emoji, str):
523523
default_reaction_emoji = PartialEmoji.from_str(default_reaction_emoji)
524+
elif default_reaction_emoji is None:
525+
pass
524526
else:
525527
raise InvalidArgument(
526-
"default_reaction_emoji must be of type: GuildEmoji | int | str"
528+
"default_reaction_emoji must be of type: GuildEmoji | int | str | None"
527529
)
528530

529531
options["default_reaction_emoji"] = (
530532
default_reaction_emoji._to_forum_reaction_payload()
533+
if default_reaction_emoji
534+
else None
531535
)
532536

533537
if options:
@@ -1493,9 +1497,9 @@ async def send(
14931497
.. versionadded:: 1.4
14941498
14951499
reference: Union[:class:`~discord.Message`, :class:`~discord.MessageReference`, :class:`~discord.PartialMessage`]
1496-
A reference to the :class:`~discord.Message` to which you are replying, this can be created using
1497-
:meth:`~discord.Message.to_reference` or passed directly as a :class:`~discord.Message`. You can control
1498-
whether this mentions the author of the referenced message using the
1500+
A reference to the :class:`~discord.Message` being replied to or forwarded. This can be created using
1501+
:meth:`~discord.Message.to_reference`.
1502+
When replying, you can control whether this mentions the author of the referenced message using the
14991503
:attr:`~discord.AllowedMentions.replied_user` attribute of ``allowed_mentions`` or by
15001504
setting ``mention_author``.
15011505
@@ -1585,9 +1589,19 @@ async def send(
15851589
allowed_mentions = allowed_mentions or AllowedMentions().to_dict()
15861590
allowed_mentions["replied_user"] = bool(mention_author)
15871591

1592+
_reference = None
15881593
if reference is not None:
15891594
try:
1590-
reference = reference.to_message_reference_dict()
1595+
_reference = reference.to_message_reference_dict()
1596+
from .message import MessageReference
1597+
1598+
if not isinstance(reference, MessageReference):
1599+
utils.warn_deprecated(
1600+
f"Passing {type(reference).__name__} to reference",
1601+
"MessageReference",
1602+
"2.7",
1603+
"3.0",
1604+
)
15911605
except AttributeError:
15921606
raise InvalidArgument(
15931607
"reference parameter must be Message, MessageReference, or"
@@ -1637,7 +1651,7 @@ async def send(
16371651
nonce=nonce,
16381652
enforce_nonce=enforce_nonce,
16391653
allowed_mentions=allowed_mentions,
1640-
message_reference=reference,
1654+
message_reference=_reference,
16411655
stickers=stickers,
16421656
components=components,
16431657
flags=flags.value,
@@ -1656,7 +1670,7 @@ async def send(
16561670
nonce=nonce,
16571671
enforce_nonce=enforce_nonce,
16581672
allowed_mentions=allowed_mentions,
1659-
message_reference=reference,
1673+
message_reference=_reference,
16601674
stickers=stickers,
16611675
components=components,
16621676
flags=flags.value,

discord/channel.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3412,6 +3412,9 @@ def get_partial_message(self, message_id: int, /) -> PartialMessage:
34123412

34133413
return PartialMessage(channel=self, id=message_id)
34143414

3415+
def __repr__(self) -> str:
3416+
return f"<PartialMessageable id={self.id} type={self.type!r}>"
3417+
34153418

34163419
def _guild_channel_factory(channel_type: int):
34173420
value = try_enum(ChannelType, channel_type)

discord/cog.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,6 @@ def __new__(cls: type[CogMeta], *args: Any, **kwargs: Any) -> CogMeta:
151151

152152
new_cls = super().__new__(cls, name, bases, attrs, **kwargs)
153153

154-
valid_commands = [
155-
(c for i, c in j.__dict__.items() if isinstance(c, _BaseCommand))
156-
for j in reversed(new_cls.__mro__)
157-
]
158-
if any(isinstance(i, ApplicationCommand) for i in valid_commands) and any(
159-
not isinstance(i, _BaseCommand) for i in valid_commands
160-
):
161-
_filter = ApplicationCommand
162-
else:
163-
_filter = _BaseCommand
164-
165154
for base in reversed(new_cls.__mro__):
166155
for elem, value in base.__dict__.items():
167156
if elem in commands:
@@ -178,7 +167,7 @@ def __new__(cls: type[CogMeta], *args: Any, **kwargs: Any) -> CogMeta:
178167
is_static_method = isinstance(value, staticmethod)
179168
if is_static_method:
180169
value = value.__func__
181-
if isinstance(value, _filter):
170+
if isinstance(value, _BaseCommand):
182171
if is_static_method:
183172
raise TypeError(
184173
f"Command in method {base}.{elem!r} must not be"

discord/commands/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,11 +2042,13 @@ def command(**kwargs):
20422042

20432043
docs = "https://discord.com/developers/docs"
20442044
valid_locales = [
2045+
"id",
20452046
"da",
20462047
"de",
20472048
"en-GB",
20482049
"en-US",
20492050
"es-ES",
2051+
"es-419",
20502052
"fr",
20512053
"hr",
20522054
"it",

discord/enums.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
"EntitlementOwnerType",
7777
"IntegrationType",
7878
"InteractionContextType",
79+
"PollLayoutType",
80+
"MessageReferenceType",
7981
)
8082

8183

@@ -266,6 +268,12 @@ class MessageType(Enum):
266268
stage_raise_hand = 30
267269
stage_topic = 31
268270
guild_application_premium_subscription = 32
271+
guild_incident_alert_mode_enabled = 36
272+
guild_incident_alert_mode_disabled = 37
273+
guild_incident_report_raid = 38
274+
guild_incident_report_false_alarm = 39
275+
purchase_notification = 44
276+
poll_result = 46
269277

270278

271279
class VoiceRegion(Enum):
@@ -1055,6 +1063,13 @@ class PollLayoutType(Enum):
10551063
default = 1
10561064

10571065

1066+
class MessageReferenceType(Enum):
1067+
"""The type of the message reference object"""
1068+
1069+
default = 0
1070+
forward = 1
1071+
1072+
10581073
class SubscriptionStatus(Enum):
10591074
"""The status of a subscription."""
10601075

discord/ext/bridge/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def __getattribute__(self, name):
232232
except AttributeError as e:
233233
# if it doesn't exist, check this list, if the name of
234234
# the parameter is here
235-
if name is self.__special_attrs__:
235+
if name in self.__special_attrs__:
236236
raise e
237237

238238
# looks up the result in the variants.

0 commit comments

Comments
 (0)