From bc7b32f2f1f80c7063ce411489678c47437fb103 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 17:48:54 +0200 Subject: [PATCH 01/24] :memo: Remove empty note in CategoryChannel --- discord/channel.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index e6850930ab..e5e55f360c 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2884,8 +2884,6 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable): The position in the category list. This is a number that starts at 0. e.g. the top category is position 0. Can be ``None`` if the channel was received in an interaction. - .. note:: - flags: :class:`ChannelFlags` Extra features of the channel. From a4e1b7948074608f895341ba886dbac1b067f312 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 17:53:01 +0200 Subject: [PATCH 02/24] :memo: Fix duplicate SelectOption doc --- docs/api/data_classes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/data_classes.rst b/docs/api/data_classes.rst index 2e2e814289..ad71d7deee 100644 --- a/docs/api/data_classes.rst +++ b/docs/api/data_classes.rst @@ -28,7 +28,7 @@ dynamic attributes in mind. .. attributetable:: MediaGalleryItem -.. autoclass:: SelectOption +.. autoclass:: MediaGalleryItem :members: .. attributetable:: UnfurledMediaItem From 5d4082c44f598c256d35ae72a8b2cc2b1fac8ffe Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 17:57:25 +0200 Subject: [PATCH 03/24] :memo: Add missing SortOrder enum documentation --- docs/api/enums.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/api/enums.rst b/docs/api/enums.rst index 61bedcc8dd..085c8eb342 100644 --- a/docs/api/enums.rst +++ b/docs/api/enums.rst @@ -2572,3 +2572,15 @@ of :class:`enum.Enum`. .. attribute:: large The separator uses large padding. + +.. class:: SortOrder + + Used to represent the default sort order for posts in :class:`ForumChannel` and :class:`MediaChannel`. + + .. attribute:: latest_activity + + Sort by latest activity. + + .. attribute:: creation_date + + Sort by post creation date. From 855d05dd2cc6219fc38793cce3a258fea2e4c691 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:00:07 +0200 Subject: [PATCH 04/24] :memo: Fix "Message Components" docs section underline length --- docs/api/models.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/models.rst b/docs/api/models.rst index 7ee6d0f7ef..ef5aaabdbe 100644 --- a/docs/api/models.rst +++ b/docs/api/models.rst @@ -374,7 +374,7 @@ Interactions :members: Message Components ------------- +------------------ .. attributetable:: Component From 44757e34233ed55adc98ff7d767648788b741a1d Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:18:04 +0200 Subject: [PATCH 05/24] :memo: Add docs to on_view_error and on_modal_error events thigny --- discord/client.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/discord/client.py b/discord/client.py index c663395ef7..5faab8efef 100644 --- a/discord/client.py +++ b/discord/client.py @@ -553,6 +553,15 @@ async def on_view_error( The default view error handler provided by the client. This only fires for a view if you did not define its :func:`~discord.ui.View.on_error`. + + Parameters + ---------- + error: :class:`Exception` + The exception that was raised. + item: :class:`Item` + The item that the user interacted with. + interaction: :class:`Interaction` + The interaction that was received. """ print( @@ -570,6 +579,13 @@ async def on_modal_error(self, error: Exception, interaction: Interaction) -> No The default implementation prints the traceback to stderr. This only fires for a modal if you did not define its :func:`~discord.ui.Modal.on_error`. + + Parameters + ---------- + error: :class:`Exception` + The exception that was raised. + interaction: :class:`Interaction` + The interaction that was received. """ print(f"Ignoring exception in modal {interaction.modal}:", file=sys.stderr) From 0aba3613ce5e2f5953103aced346cb3145a4b4c3 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:20:46 +0200 Subject: [PATCH 06/24] :memo: fix typo in Client.get_poll docstring --- discord/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/client.py b/discord/client.py index 5faab8efef..a2530edcac 100644 --- a/discord/client.py +++ b/discord/client.py @@ -1119,7 +1119,7 @@ def get_poll(self, id: int, /) -> Poll | None: Returns ------- - Optional[:class:`.Poll`] + Optional[:class:`Poll`] The poll or ``None`` if not found. """ return self._connection.get_poll(id) From 6ac322a932457225ef0814461dbe43c0cdba9656 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:21:35 +0200 Subject: [PATCH 07/24] :memo: Fix incorrect VoiceChannelEffectSendEvent import --- discord/raw_models.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/discord/raw_models.py b/discord/raw_models.py index d58b8e4278..56d8387b1a 100644 --- a/discord/raw_models.py +++ b/discord/raw_models.py @@ -46,6 +46,7 @@ from .soundboard import PartialSoundboardSound, SoundboardSound from .state import ConnectionState from .threads import Thread + from .types.channel import VoiceChannelEffectSendEvent as VoiceChannelEffectSend from .types.raw_models import ( AuditLogEntryEvent, ) @@ -65,9 +66,6 @@ ThreadMembersUpdateEvent, ThreadUpdateEvent, TypingEvent, - ) - from .types.raw_models import VoiceChannelEffectSendEvent as VoiceChannelEffectSend - from .types.raw_models import ( VoiceChannelStatusUpdateEvent, ) from .user import User From 9c397f240f50ff99f746f84e206ac1efad6ae391 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:23:53 +0200 Subject: [PATCH 08/24] :memo: Fix duplicate Guild.invites_disabled documentation --- discord/guild.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/discord/guild.py b/discord/guild.py index cf25ab8a36..0edb000f94 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -175,8 +175,6 @@ class Guild(Hashable): The channel that denotes the AFK channel. ``None`` if it doesn't exist. id: :class:`int` The guild's ID. - invites_disabled: :class:`bool` - Indicates if the guild invites are disabled. owner_id: :class:`int` The guild owner's ID. Use :attr:`Guild.owner` instead. unavailable: :class:`bool` @@ -1190,7 +1188,7 @@ def created_at(self) -> datetime.datetime: @property def invites_disabled(self) -> bool: - """Returns a boolean indicating if the guild invites are disabled.""" + """A boolean indicating if the guild invites are disabled.""" return "INVITES_DISABLED" in self.features def get_member_named(self, name: str, /) -> Member | None: From 1ce1f84d477e7b8717df31d4d1527216bf1a1d9a Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:24:55 +0200 Subject: [PATCH 09/24] :memo: Fix duplicate UnfurledMediaItem.url documentation --- discord/components.py | 1 - 1 file changed, 1 deletion(-) diff --git a/discord/components.py b/discord/components.py index 3de19a7fc0..baa2483fe1 100644 --- a/discord/components.py +++ b/discord/components.py @@ -743,7 +743,6 @@ def __str__(self) -> str: @property def url(self) -> str: - """Returns this media item's url.""" return self._url @url.setter From 6e2272ee539da3c401917f4f574f0d03464bb796 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:25:14 +0200 Subject: [PATCH 10/24] :memo: Fix duplicate MediaGalleryItem.url documentation --- discord/components.py | 1 - 1 file changed, 1 deletion(-) diff --git a/discord/components.py b/discord/components.py index baa2483fe1..a798edb74d 100644 --- a/discord/components.py +++ b/discord/components.py @@ -849,7 +849,6 @@ def __init__(self, url, *, description=None, spoiler=False): @property def url(self) -> str: - """Returns the URL of this gallery's underlying media item.""" return self.media.url def is_dispatchable(self) -> bool: From d732475faca9dc498af151f4c24d07eed097bec1 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:27:16 +0200 Subject: [PATCH 11/24] :memo: Fix typo in Client.get_all_members docstring --- discord/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/client.py b/discord/client.py index a2530edcac..56eb646790 100644 --- a/discord/client.py +++ b/discord/client.py @@ -1159,7 +1159,7 @@ def get_all_members(self) -> Generator[Member]: Yields ------ - :class:`.Member` + :class:`Member` A member the client can see. """ for guild in self.guilds: From 7595731ba9aca33d4c0c5e6d7edb2c8e8c249040 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:31:45 +0200 Subject: [PATCH 12/24] Revert ":memo: Fix typo in Client.get_all_members docstring" This reverts commit d732475faca9dc498af151f4c24d07eed097bec1. --- discord/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/client.py b/discord/client.py index 56eb646790..a2530edcac 100644 --- a/discord/client.py +++ b/discord/client.py @@ -1159,7 +1159,7 @@ def get_all_members(self) -> Generator[Member]: Yields ------ - :class:`Member` + :class:`.Member` A member the client can see. """ for guild in self.guilds: From ae087a71a7972f417311208834b72dc6819611bf Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:31:54 +0200 Subject: [PATCH 13/24] Revert ":memo: fix typo in Client.get_poll docstring" This reverts commit 0aba3613ce5e2f5953103aced346cb3145a4b4c3. --- discord/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/client.py b/discord/client.py index a2530edcac..5faab8efef 100644 --- a/discord/client.py +++ b/discord/client.py @@ -1119,7 +1119,7 @@ def get_poll(self, id: int, /) -> Poll | None: Returns ------- - Optional[:class:`Poll`] + Optional[:class:`.Poll`] The poll or ``None`` if not found. """ return self._connection.get_poll(id) From 7eb887b786abf7d9339db6b537254821a83381a2 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:32:24 +0200 Subject: [PATCH 14/24] Update discord/guild.py Co-authored-by: Lala Sabathil Signed-off-by: Paillat --- discord/guild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/guild.py b/discord/guild.py index 0edb000f94..807a6e88a2 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1188,7 +1188,7 @@ def created_at(self) -> datetime.datetime: @property def invites_disabled(self) -> bool: - """A boolean indicating if the guild invites are disabled.""" + """A boolean indicating whether the guild invites are disabled.""" return "INVITES_DISABLED" in self.features def get_member_named(self, name: str, /) -> Member | None: From c139c79a7ada84bbdcc6ef29d516e8022981aef9 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:39:57 +0200 Subject: [PATCH 15/24] :memo: Fix missing OnboardingPrompt import --- discord/guild.py | 1 + 1 file changed, 1 insertion(+) diff --git a/discord/guild.py b/discord/guild.py index 807a6e88a2..7a280259fd 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -104,6 +104,7 @@ TextChannel, VoiceChannel, ) + from .onboarding import OnboardingPrompt from .permissions import Permissions from .state import ConnectionState from .template import Template From 2fcc7de4f14c624756e628e82657265136e4af31 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:40:17 +0200 Subject: [PATCH 16/24] :memo: Fix typo in Guild.get_sound --- discord/guild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/guild.py b/discord/guild.py index 7a280259fd..1ffd707229 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -4508,7 +4508,7 @@ def entitlements( exclude_ended=exclude_ended, ) - def get_sound(self, sound_id: int) -> Soundboard | None: + def get_sound(self, sound_id: int) -> SoundboardSound | None: """Returns a sound with the given ID. .. versionadded :: 2.7 From 7111dce93238fee0f2011f3ab1e548ffb9d752b1 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:41:06 +0200 Subject: [PATCH 17/24] :memo: Add missing SortOrder import --- discord/guild.py | 1 + 1 file changed, 1 insertion(+) diff --git a/discord/guild.py b/discord/guild.py index 1ffd707229..f6bd65f27c 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -58,6 +58,7 @@ NSFWLevel, ScheduledEventLocationType, ScheduledEventPrivacyLevel, + SortOrder, VerificationLevel, VideoQualityMode, VoiceRegion, From fd603897dbfba03a4aabe9fc39e2c5e399a216ca Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:42:26 +0200 Subject: [PATCH 18/24] :memo: Fix typo in interaction import --- discord/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/client.py b/discord/client.py index 5faab8efef..c92508e502 100644 --- a/discord/client.py +++ b/discord/client.py @@ -69,7 +69,7 @@ if TYPE_CHECKING: from .abc import GuildChannel, PrivateChannel, Snowflake, SnowflakeTime from .channel import DMChannel - from .interaction import Interaction + from .interactions import Interaction from .member import Member from .message import Message from .poll import Poll From 7ef7ee4d67e0f625d73cf2ac2697e4b3c47779e4 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:47:16 +0200 Subject: [PATCH 19/24] :memo: Add missing OnboardingMode import --- discord/guild.py | 1 + 1 file changed, 1 insertion(+) diff --git a/discord/guild.py b/discord/guild.py index f6bd65f27c..ff4c9e04b2 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -56,6 +56,7 @@ EntitlementOwnerType, NotificationLevel, NSFWLevel, + OnboardingMode, ScheduledEventLocationType, ScheduledEventPrivacyLevel, SortOrder, From ca95316e126a5f9bf4a0a5860ee26777eb24dd95 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sat, 30 Aug 2025 18:48:20 +0200 Subject: [PATCH 20/24] :memo: Fix underline too short --- docs/ext/bridge/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ext/bridge/api.rst b/docs/ext/bridge/api.rst index 370b2f3c5d..63fe6d18c0 100644 --- a/docs/ext/bridge/api.rst +++ b/docs/ext/bridge/api.rst @@ -159,7 +159,7 @@ BridgeContext Subclasses Alias of :data:`typing.Union` [ :class:`.BridgeExtContext`, :class:`.BridgeApplicationContext` ] for typing convenience. Options ------- +------- Shortcut Decorators ~~~~~~~~~~~~~~~~~~~ From 6acbdae01d6a75d7e8ce9376ad343fdbd0e47449 Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Sat, 30 Aug 2025 19:08:27 +0200 Subject: [PATCH 21/24] Enable autosectionlabel warning suppression in docs Uncommented the suppress_warnings setting in conf.py to suppress warnings related to autosectionlabel. This helps reduce noise during documentation builds. --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index d206bb78b8..dd12e5249c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -499,7 +499,7 @@ def write_new(): linkcheck_anchors_ignore_for_url = [r"https://github.com/Delitefully/DiscordLists"] modindex_common_prefix = ["discord."] -# suppress_warnings = ['autosectionlabel.*'] +suppress_warnings = ['autosectionlabel.*'] myst_enable_extensions = [ "amsmath", "attrs_inline", From 7e5480b9b04507b3be553cc69e7e40b9e17c358d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 30 Aug 2025 17:12:40 +0000 Subject: [PATCH 22/24] style(pre-commit): auto fixes from pre-commit.com hooks --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index dd12e5249c..7cd2e28dfd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -499,7 +499,7 @@ def write_new(): linkcheck_anchors_ignore_for_url = [r"https://github.com/Delitefully/DiscordLists"] modindex_common_prefix = ["discord."] -suppress_warnings = ['autosectionlabel.*'] +suppress_warnings = ["autosectionlabel.*"] myst_enable_extensions = [ "amsmath", "attrs_inline", From dbc20f441b91d4ae1b06336630df6e9cd0456542 Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Sat, 30 Aug 2025 20:04:10 +0200 Subject: [PATCH 23/24] fix some more sphinx errors --- discord/client.py | 4 ++-- discord/ext/bridge/core.py | 8 ++++++-- discord/ext/commands/core.py | 4 +++- docs/api/enums.rst | 2 +- docs/api/events.rst | 4 ++-- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/discord/client.py b/discord/client.py index c92508e502..ed6cdb8991 100644 --- a/discord/client.py +++ b/discord/client.py @@ -1313,7 +1313,7 @@ def add_listener(self, func: Coro, name: str = MISSING) -> None: TypeError The ``func`` parameter is not a coroutine function. ValueError - The ``name`` (event name) does not start with 'on_' + The ``name`` (event name) does not start with ``on_``. Example ------- @@ -1377,7 +1377,7 @@ def listen(self, name: str = MISSING, once: bool = False) -> Callable[[Coro], Co TypeError The function being listened to is not a coroutine. ValueError - The ``name`` (event name) does not start with 'on_' + The ``name`` (event name) does not start with ``on_``. Example ------- diff --git a/discord/ext/bridge/core.py b/discord/ext/bridge/core.py index dbf7e28a3c..ef31e01d79 100644 --- a/discord/ext/bridge/core.py +++ b/discord/ext/bridge/core.py @@ -185,8 +185,10 @@ def __init__(self, callback, **kwargs): @property def name_localizations(self) -> dict[str, str] | None: """Returns name_localizations from :attr:`slash_variant` - You can edit/set name_localizations directly with + You can edit/set name_localizations directly with + .. code-block:: python3 + bridge_command.name_localizations["en-UK"] = ... # or any other locale # or bridge_command.name_localizations = {"en-UK": ..., "fr-FR": ...} @@ -200,8 +202,10 @@ def name_localizations(self, value): @property def description_localizations(self) -> dict[str, str] | None: """Returns description_localizations from :attr:`slash_variant` - You can edit/set description_localizations directly with + You can edit/set description_localizations directly with + .. code-block:: python3 + bridge_command.description_localizations["en-UK"] = ... # or any other locale # or bridge_command.description_localizations = {"en-UK": ..., "fr-FR": ...} diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 6f6ef1dffa..cf5c26eed4 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -1687,6 +1687,7 @@ def command( ------ TypeError If the function is not a coroutine or is already a command. + """ if cls is MISSING: cls = Command # type: ignore @@ -1877,7 +1878,7 @@ def check_any(*checks: Check) -> Callable[[T], T]: the :func:`check` decorator. Raises - ------- + ------ TypeError A check passed has not been decorated with the :func:`check` decorator. @@ -1899,6 +1900,7 @@ def predicate(ctx): @commands.check_any(commands.is_owner(), is_guild_owner()) async def only_for_owners(ctx): await ctx.send('Hello mister owner!') + """ unwrapped = [] diff --git a/docs/api/enums.rst b/docs/api/enums.rst index 085c8eb342..7ceb0db38a 100644 --- a/docs/api/enums.rst +++ b/docs/api/enums.rst @@ -2362,7 +2362,7 @@ of :class:`enum.Enum`. .. attribute:: advanced - Both default channels and questions (``OnboardingPrompt``s) will count towards the Onboarding requirements. + Both default channels and questions (``OnboardingPrompt``\s) will count towards the Onboarding requirements. .. class:: ReactionType diff --git a/docs/api/events.rst b/docs/api/events.rst index b1f08b89e7..45d8c1e279 100644 --- a/docs/api/events.rst +++ b/docs/api/events.rst @@ -1456,9 +1456,9 @@ Soundboard Sound .. versionadded:: 2.7 :param before: The soundboard sound prior to being updated. - :type before: :class:`Soundboard + :type before: :class:`Soundboard` :param after: The soundboard sound after being updated. - :type after: :class:`Soundboard + :type after: :class:`Soundboard` .. function:: on_raw_soundboard_sound_update(after) From 748246b8ee2742b0fc12e099d3f6bbc0bab44d4d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 30 Aug 2025 18:04:38 +0000 Subject: [PATCH 24/24] style(pre-commit): auto fixes from pre-commit.com hooks --- discord/ext/commands/core.py | 1 - 1 file changed, 1 deletion(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index cf5c26eed4..1a0d8a09a2 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -1687,7 +1687,6 @@ def command( ------ TypeError If the function is not a coroutine or is already a command. - """ if cls is MISSING: cls = Command # type: ignore