Skip to content

Commit 8b4364e

Browse files
authored
Merge branch 'master' into feat/audioop
2 parents 1d4c9e5 + 1273941 commit 8b4364e

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ These changes are available on the `master` branch, but have not yet been releas
4040
- Fixed `Guild.create_test_entitlement()` and `User.create_test_entitlement()` using the
4141
guild/user ID instead of the application ID.
4242
([#2595](https://github.com/Pycord-Development/pycord/pull/2595))
43+
- Fixed commands with `BucketType.cagegory` cooldown causing issues in private channels.
44+
([#2603](https://github.com/Pycord-Development/pycord/pull/2603))
4345

4446
### Changed
4547

discord/ext/commands/cooldowns.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from collections import deque
3131
from typing import TYPE_CHECKING, Any, Callable, Deque, TypeVar
3232

33+
import discord.abc
3334
from discord.enums import Enum
3435

3536
from ...abc import PrivateChannel
@@ -69,7 +70,12 @@ def get_key(self, msg: Message) -> Any:
6970
elif self is BucketType.member:
7071
return (msg.guild and msg.guild.id), msg.author.id
7172
elif self is BucketType.category:
72-
return (msg.channel.category or msg.channel).id # type: ignore
73+
return (
74+
msg.channel.category.id
75+
if isinstance(msg.channel, discord.abc.GuildChannel)
76+
and msg.channel.category
77+
else msg.channel.id
78+
)
7379
elif self is BucketType.role:
7480
# we return the channel id of a private-channel as there are only roles in guilds
7581
# and that yields the same result as for a guild with only the @everyone role

discord/message.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,8 @@ async def edit(
15481548
15491549
Raises
15501550
------
1551+
NotFound
1552+
The message was not found.
15511553
HTTPException
15521554
Editing the message failed.
15531555
Forbidden

docs/old_changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ Bug Fixes
625625
- Fix out of order files being sent in webhooks when there are 10 files.
626626
- |commands| Extensions that fail internally due to ImportError will no longer raise :exc:`~.ext.commands.ExtensionNotFound`. (:dpy-issue:`2244`, :dpy-issue:`2275`, :dpy-issue:`2291`)
627627
- |commands| Updating the :attr:`Paginator.suffix <.ext.commands.Paginator.suffix>` will not cause out of date calculations. (:dpy-issue:`2251`)
628-
- |commands| Allow converters from custom extension packages. (:dpy-issue:`2369`, :dpy-issue:`2374`)
628+
- |commands| Allow converters from custom extension packages. (:dpy-issue:`2369`, 2374)
629629
- |commands| Fix issue with paginator prefix being ``None`` causing empty pages. (:dpy-issue:`2471`)
630630
- |commands| :class:`~.commands.Greedy` now ignores parsing errors rather than propagating them.
631631
- |commands| :meth:`Command.can_run <.ext.commands.Command.can_run>` now checks whether a command is disabled.

requirements/dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pytest-asyncio~=0.23.8
55
# pytest-order~=1.0.1
66
mypy~=1.11.2
77
coverage~=7.6
8-
pre-commit==4.0.0
8+
pre-commit==4.0.1
99
codespell==2.3.0
1010
bandit==1.7.10
1111
flake8==7.1.1

0 commit comments

Comments
 (0)