Skip to content

Commit bc5b9a3

Browse files
Paillat-devLulalabypre-commit-ci[bot]
authored
docs: 📝 Fixes (#2892)
Signed-off-by: Paillat <[email protected]> Co-authored-by: Lala Sabathil <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent bd771d9 commit bc5b9a3

File tree

13 files changed

+52
-24
lines changed

13 files changed

+52
-24
lines changed

discord/channel.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,8 +2884,6 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable):
28842884
The position in the category list. This is a number that starts at 0. e.g. the
28852885
top category is position 0. Can be ``None`` if the channel was received in an interaction.
28862886
2887-
.. note::
2888-
28892887
flags: :class:`ChannelFlags`
28902888
Extra features of the channel.
28912889

discord/client.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
if TYPE_CHECKING:
7070
from .abc import GuildChannel, PrivateChannel, Snowflake, SnowflakeTime
7171
from .channel import DMChannel
72-
from .interaction import Interaction
72+
from .interactions import Interaction
7373
from .member import Member
7474
from .message import Message
7575
from .poll import Poll
@@ -553,6 +553,15 @@ async def on_view_error(
553553
The default view error handler provided by the client.
554554
555555
This only fires for a view if you did not define its :func:`~discord.ui.View.on_error`.
556+
557+
Parameters
558+
----------
559+
error: :class:`Exception`
560+
The exception that was raised.
561+
item: :class:`Item`
562+
The item that the user interacted with.
563+
interaction: :class:`Interaction`
564+
The interaction that was received.
556565
"""
557566

558567
print(
@@ -570,6 +579,13 @@ async def on_modal_error(self, error: Exception, interaction: Interaction) -> No
570579
The default implementation prints the traceback to stderr.
571580
572581
This only fires for a modal if you did not define its :func:`~discord.ui.Modal.on_error`.
582+
583+
Parameters
584+
----------
585+
error: :class:`Exception`
586+
The exception that was raised.
587+
interaction: :class:`Interaction`
588+
The interaction that was received.
573589
"""
574590

575591
print(f"Ignoring exception in modal {interaction.modal}:", file=sys.stderr)
@@ -1297,7 +1313,7 @@ def add_listener(self, func: Coro, name: str = MISSING) -> None:
12971313
TypeError
12981314
The ``func`` parameter is not a coroutine function.
12991315
ValueError
1300-
The ``name`` (event name) does not start with 'on_'
1316+
The ``name`` (event name) does not start with ``on_``.
13011317
13021318
Example
13031319
-------
@@ -1361,7 +1377,7 @@ def listen(self, name: str = MISSING, once: bool = False) -> Callable[[Coro], Co
13611377
TypeError
13621378
The function being listened to is not a coroutine.
13631379
ValueError
1364-
The ``name`` (event name) does not start with 'on_'
1380+
The ``name`` (event name) does not start with ``on_``.
13651381
13661382
Example
13671383
-------

discord/components.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,6 @@ def __str__(self) -> str:
743743

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

749748
@url.setter
@@ -850,7 +849,6 @@ def __init__(self, url, *, description=None, spoiler=False):
850849

851850
@property
852851
def url(self) -> str:
853-
"""Returns the URL of this gallery's underlying media item."""
854852
return self.media.url
855853

856854
def is_dispatchable(self) -> bool:

discord/ext/bridge/core.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,10 @@ def __init__(self, callback, **kwargs):
185185
@property
186186
def name_localizations(self) -> dict[str, str] | None:
187187
"""Returns name_localizations from :attr:`slash_variant`
188-
You can edit/set name_localizations directly with
188+
You can edit/set name_localizations directly with
189+
189190
.. code-block:: python3
191+
190192
bridge_command.name_localizations["en-UK"] = ... # or any other locale
191193
# or
192194
bridge_command.name_localizations = {"en-UK": ..., "fr-FR": ...}
@@ -200,8 +202,10 @@ def name_localizations(self, value):
200202
@property
201203
def description_localizations(self) -> dict[str, str] | None:
202204
"""Returns description_localizations from :attr:`slash_variant`
203-
You can edit/set description_localizations directly with
205+
You can edit/set description_localizations directly with
206+
204207
.. code-block:: python3
208+
205209
bridge_command.description_localizations["en-UK"] = ... # or any other locale
206210
# or
207211
bridge_command.description_localizations = {"en-UK": ..., "fr-FR": ...}

discord/ext/commands/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1877,7 +1877,7 @@ def check_any(*checks: Check) -> Callable[[T], T]:
18771877
the :func:`check` decorator.
18781878
18791879
Raises
1880-
-------
1880+
------
18811881
TypeError
18821882
A check passed has not been decorated with the :func:`check`
18831883
decorator.
@@ -1899,6 +1899,7 @@ def predicate(ctx):
18991899
@commands.check_any(commands.is_owner(), is_guild_owner())
19001900
async def only_for_owners(ctx):
19011901
await ctx.send('Hello mister owner!')
1902+
19021903
"""
19031904

19041905
unwrapped = []

discord/guild.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656
EntitlementOwnerType,
5757
NotificationLevel,
5858
NSFWLevel,
59+
OnboardingMode,
5960
ScheduledEventLocationType,
6061
ScheduledEventPrivacyLevel,
62+
SortOrder,
6163
VerificationLevel,
6264
VideoQualityMode,
6365
VoiceRegion,
@@ -104,6 +106,7 @@
104106
TextChannel,
105107
VoiceChannel,
106108
)
109+
from .onboarding import OnboardingPrompt
107110
from .permissions import Permissions
108111
from .state import ConnectionState
109112
from .template import Template
@@ -175,8 +178,6 @@ class Guild(Hashable):
175178
The channel that denotes the AFK channel. ``None`` if it doesn't exist.
176179
id: :class:`int`
177180
The guild's ID.
178-
invites_disabled: :class:`bool`
179-
Indicates if the guild invites are disabled.
180181
owner_id: :class:`int`
181182
The guild owner's ID. Use :attr:`Guild.owner` instead.
182183
unavailable: :class:`bool`
@@ -1190,7 +1191,7 @@ def created_at(self) -> datetime.datetime:
11901191

11911192
@property
11921193
def invites_disabled(self) -> bool:
1193-
"""Returns a boolean indicating if the guild invites are disabled."""
1194+
"""A boolean indicating whether the guild invites are disabled."""
11941195
return "INVITES_DISABLED" in self.features
11951196

11961197
def get_member_named(self, name: str, /) -> Member | None:
@@ -4509,7 +4510,7 @@ def entitlements(
45094510
exclude_ended=exclude_ended,
45104511
)
45114512

4512-
def get_sound(self, sound_id: int) -> Soundboard | None:
4513+
def get_sound(self, sound_id: int) -> SoundboardSound | None:
45134514
"""Returns a sound with the given ID.
45144515
45154516
.. versionadded :: 2.7

discord/raw_models.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
from .soundboard import PartialSoundboardSound, SoundboardSound
4747
from .state import ConnectionState
4848
from .threads import Thread
49+
from .types.channel import VoiceChannelEffectSendEvent as VoiceChannelEffectSend
4950
from .types.raw_models import (
5051
AuditLogEntryEvent,
5152
)
@@ -65,9 +66,6 @@
6566
ThreadMembersUpdateEvent,
6667
ThreadUpdateEvent,
6768
TypingEvent,
68-
)
69-
from .types.raw_models import VoiceChannelEffectSendEvent as VoiceChannelEffectSend
70-
from .types.raw_models import (
7169
VoiceChannelStatusUpdateEvent,
7270
)
7371
from .user import User

docs/api/data_classes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dynamic attributes in mind.
2828

2929
.. attributetable:: MediaGalleryItem
3030

31-
.. autoclass:: SelectOption
31+
.. autoclass:: MediaGalleryItem
3232
:members:
3333

3434
.. attributetable:: UnfurledMediaItem

docs/api/enums.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ of :class:`enum.Enum`.
23622362

23632363
.. attribute:: advanced
23642364

2365-
Both default channels and questions (``OnboardingPrompt``s) will count towards the Onboarding requirements.
2365+
Both default channels and questions (``OnboardingPrompt``\s) will count towards the Onboarding requirements.
23662366

23672367
.. class:: ReactionType
23682368

@@ -2572,3 +2572,15 @@ of :class:`enum.Enum`.
25722572
.. attribute:: large
25732573

25742574
The separator uses large padding.
2575+
2576+
.. class:: SortOrder
2577+
2578+
Used to represent the default sort order for posts in :class:`ForumChannel` and :class:`MediaChannel`.
2579+
2580+
.. attribute:: latest_activity
2581+
2582+
Sort by latest activity.
2583+
2584+
.. attribute:: creation_date
2585+
2586+
Sort by post creation date.

docs/api/events.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,9 +1456,9 @@ Soundboard Sound
14561456
.. versionadded:: 2.7
14571457

14581458
:param before: The soundboard sound prior to being updated.
1459-
:type before: :class:`Soundboard
1459+
:type before: :class:`Soundboard`
14601460
:param after: The soundboard sound after being updated.
1461-
:type after: :class:`Soundboard
1461+
:type after: :class:`Soundboard`
14621462

14631463
.. function:: on_raw_soundboard_sound_update(after)
14641464

0 commit comments

Comments
 (0)