Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bc7b32f
:memo: Remove empty note in CategoryChannel
Paillat-dev Aug 30, 2025
a4e1b79
:memo: Fix duplicate SelectOption doc
Paillat-dev Aug 30, 2025
5d4082c
:memo: Add missing SortOrder enum documentation
Paillat-dev Aug 30, 2025
855d05d
:memo: Fix "Message Components" docs section underline length
Paillat-dev Aug 30, 2025
60fa71a
Merge branch 'master' into docs-fixes
Paillat-dev Aug 30, 2025
44757e3
:memo: Add docs to on_view_error and on_modal_error events thigny
Paillat-dev Aug 30, 2025
0aba361
:memo: fix typo in Client.get_poll docstring
Paillat-dev Aug 30, 2025
6ac322a
:memo: Fix incorrect VoiceChannelEffectSendEvent import
Paillat-dev Aug 30, 2025
9c397f2
:memo: Fix duplicate Guild.invites_disabled documentation
Paillat-dev Aug 30, 2025
1ce1f84
:memo: Fix duplicate UnfurledMediaItem.url documentation
Paillat-dev Aug 30, 2025
6e2272e
:memo: Fix duplicate MediaGalleryItem.url documentation
Paillat-dev Aug 30, 2025
d732475
:memo: Fix typo in Client.get_all_members docstring
Paillat-dev Aug 30, 2025
7595731
Revert ":memo: Fix typo in Client.get_all_members docstring"
Paillat-dev Aug 30, 2025
ae087a7
Revert ":memo: fix typo in Client.get_poll docstring"
Paillat-dev Aug 30, 2025
7eb887b
Update discord/guild.py
Paillat-dev Aug 30, 2025
c139c79
:memo: Fix missing OnboardingPrompt import
Paillat-dev Aug 30, 2025
2fcc7de
:memo: Fix typo in Guild.get_sound
Paillat-dev Aug 30, 2025
7111dce
:memo: Add missing SortOrder import
Paillat-dev Aug 30, 2025
fd60389
:memo: Fix typo in interaction import
Paillat-dev Aug 30, 2025
7ef7ee4
:memo: Add missing OnboardingMode import
Paillat-dev Aug 30, 2025
ca95316
:memo: Fix underline too short
Paillat-dev Aug 30, 2025
6acbdae
Enable autosectionlabel warning suppression in docs
Lulalaby Aug 30, 2025
7e5480b
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 30, 2025
dbc20f4
fix some more sphinx errors
Lulalaby Aug 30, 2025
748246b
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
22 changes: 19 additions & 3 deletions discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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)
Expand Down Expand Up @@ -1297,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
-------
Expand Down Expand Up @@ -1361,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
-------
Expand Down
2 changes: 0 additions & 2 deletions discord/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,6 @@ def __str__(self) -> str:

@property
def url(self) -> str:
"""Returns this media item's url."""
return self._url

@url.setter
Expand Down Expand Up @@ -850,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:
Expand Down
8 changes: 6 additions & 2 deletions discord/ext/bridge/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": ...}
Expand All @@ -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": ...}
Expand Down
3 changes: 2 additions & 1 deletion discord/ext/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,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.
Expand All @@ -1899,6 +1899,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 = []
Expand Down
9 changes: 5 additions & 4 deletions discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@
EntitlementOwnerType,
NotificationLevel,
NSFWLevel,
OnboardingMode,
ScheduledEventLocationType,
ScheduledEventPrivacyLevel,
SortOrder,
VerificationLevel,
VideoQualityMode,
VoiceRegion,
Expand Down Expand Up @@ -104,6 +106,7 @@
TextChannel,
VoiceChannel,
)
from .onboarding import OnboardingPrompt
from .permissions import Permissions
from .state import ConnectionState
from .template import Template
Expand Down Expand Up @@ -175,8 +178,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`
Expand Down Expand Up @@ -1190,7 +1191,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 whether the guild invites are disabled."""
return "INVITES_DISABLED" in self.features

def get_member_named(self, name: str, /) -> Member | None:
Expand Down Expand Up @@ -4509,7 +4510,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
Expand Down
4 changes: 1 addition & 3 deletions discord/raw_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/api/data_classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dynamic attributes in mind.

.. attributetable:: MediaGalleryItem

.. autoclass:: SelectOption
.. autoclass:: MediaGalleryItem
:members:

.. attributetable:: UnfurledMediaItem
Expand Down
14 changes: 13 additions & 1 deletion docs/api/enums.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
4 changes: 2 additions & 2 deletions docs/api/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion docs/api/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ Interactions
:members:

Message Components
------------
------------------

.. attributetable:: Component

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion docs/ext/bridge/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ BridgeContext Subclasses
Alias of :data:`typing.Union` [ :class:`.BridgeExtContext`, :class:`.BridgeApplicationContext` ] for typing convenience.

Options
------
-------

Shortcut Decorators
~~~~~~~~~~~~~~~~~~~
Expand Down
Loading