Skip to content

Commit 5f43164

Browse files
style: enable D301 (#1469)
1 parent 73242a3 commit 5f43164

Some content is hidden

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

80 files changed

+867
-868
lines changed

disnake/abc.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ def _fill_overwrites(self, data: GuildChannelPayload) -> None:
503503

504504
@property
505505
def changed_roles(self) -> list[Role]:
506-
""":class:`list`\\[:class:`.Role`]: Returns a list of roles that have been overridden from
506+
r""":class:`list`\[:class:`.Role`]: Returns a list of roles that have been overridden from
507507
their default values in the :attr:`.Guild.roles` attribute.
508508
"""
509509
ret: list[Role] = []
@@ -560,15 +560,15 @@ def overwrites_for(self, obj: Role | User) -> PermissionOverwrite:
560560

561561
@property
562562
def overwrites(self) -> dict[Role | Member, PermissionOverwrite]:
563-
"""Returns all of the channel's overwrites.
563+
r"""Returns all of the channel's overwrites.
564564
565565
This is returned as a dictionary where the key contains the target which
566566
can be either a :class:`~disnake.Role` or a :class:`~disnake.Member` and the value is the
567567
overwrite as a :class:`~disnake.PermissionOverwrite`.
568568
569569
Returns
570570
-------
571-
:class:`dict`\\[:class:`~disnake.Role` | :class:`~disnake.Member`, :class:`~disnake.PermissionOverwrite`]
571+
:class:`dict`\[:class:`~disnake.Role` | :class:`~disnake.Member`, :class:`~disnake.PermissionOverwrite`]
572572
The channel's permission overwrites.
573573
"""
574574
ret = {}
@@ -1385,7 +1385,7 @@ async def create_invite(
13851385
return invite
13861386

13871387
async def invites(self) -> list[Invite]:
1388-
"""|coro|
1388+
r"""|coro|
13891389
13901390
Returns a list of all active instant invites from this channel.
13911391
@@ -1400,7 +1400,7 @@ async def invites(self) -> list[Invite]:
14001400
14011401
Returns
14021402
-------
1403-
:class:`list`\\[:class:`.Invite`]
1403+
:class:`list`\[:class:`.Invite`]
14041404
The list of invites that are currently active.
14051405
"""
14061406
state = self._state
@@ -1537,7 +1537,7 @@ async def send(
15371537
components: MessageComponents | None = None,
15381538
poll: Poll | None = None,
15391539
):
1540-
"""|coro|
1540+
r"""|coro|
15411541
15421542
Sends a message to the destination with the content given.
15431543
@@ -1568,18 +1568,18 @@ async def send(
15681568
embed: :class:`.Embed`
15691569
The rich embed for the content to send. This cannot be mixed with the
15701570
``embeds`` parameter.
1571-
embeds: :class:`list`\\[:class:`.Embed`]
1571+
embeds: :class:`list`\[:class:`.Embed`]
15721572
A list of embeds to send with the content. Must be a maximum of 10.
15731573
This cannot be mixed with the ``embed`` parameter.
15741574
15751575
.. versionadded:: 2.0
15761576
15771577
file: :class:`~disnake.File`
15781578
The file to upload. This cannot be mixed with the ``files`` parameter.
1579-
files: :class:`list`\\[:class:`~disnake.File`]
1579+
files: :class:`list`\[:class:`~disnake.File`]
15801580
A list of files to upload. Must be a maximum of 10.
15811581
This cannot be mixed with the ``file`` parameter.
1582-
stickers: :class:`~collections.abc.Sequence`\\[:class:`.GuildSticker` | :class:`.StandardSticker` | :class:`.StickerItem`]
1582+
stickers: :class:`~collections.abc.Sequence`\[:class:`.GuildSticker` | :class:`.StandardSticker` | :class:`.StickerItem`]
15831583
A list of stickers to upload. Must be a maximum of 3.
15841584
15851585
.. versionadded:: 2.0
@@ -1880,7 +1880,7 @@ async def fetch_message(self, id: int, /) -> Message:
18801880
def pins(
18811881
self, *, limit: int | None = 50, before: SnowflakeTime | None = None
18821882
) -> ChannelPinsIterator:
1883-
"""Returns an :class:`.AsyncIterator` that enables receiving the destination's pinned messages.
1883+
r"""Returns an :class:`.AsyncIterator` that enables receiving the destination's pinned messages.
18841884
18851885
You must have the :attr:`.Permissions.read_message_history` and :attr:`.Permissions.view_channel` permissions to use this.
18861886
@@ -1892,7 +1892,7 @@ def pins(
18921892
18931893
.. versionchanged:: 2.11
18941894
Now returns an :class:`.AsyncIterator` to support changes in Discord's API.
1895-
``await``\\ing the result of this method remains supported, but only returns the
1895+
``await``\ing the result of this method remains supported, but only returns the
18961896
last 50 pins and is deprecated in favor of ``async for msg in channel.pins()``.
18971897
18981898
Examples
@@ -2041,7 +2041,7 @@ async def connect(
20412041
reconnect: bool = True,
20422042
cls: Callable[[Client, Connectable], VoiceProtocolT] = VoiceClient,
20432043
) -> VoiceProtocolT:
2044-
"""|coro|
2044+
r"""|coro|
20452045
20462046
Connects to voice and creates a :class:`VoiceClient` to establish
20472047
your connection to the voice server.
@@ -2056,7 +2056,7 @@ async def connect(
20562056
Whether the bot should automatically attempt
20572057
a reconnect if a part of the handshake fails
20582058
or the gateway goes down.
2059-
cls: :class:`type`\\[:class:`VoiceProtocol`]
2059+
cls: :class:`type`\[:class:`VoiceProtocol`]
20602060
A type that subclasses :class:`VoiceProtocol` to connect with.
20612061
Defaults to :class:`VoiceClient`.
20622062

disnake/activity.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class BaseActivity(_BaseActivity):
234234

235235

236236
class Activity(BaseActivity):
237-
"""Represents an activity in Discord.
237+
r"""Represents an activity in Discord.
238238
239239
This could be an activity such as streaming, playing, listening
240240
or watching.
@@ -283,7 +283,7 @@ class Activity(BaseActivity):
283283
284284
- ``id``: A string representing the party ID.
285285
- ``size``: A list of two integers denoting (current_size, maximum_size).
286-
buttons: :class:`list`\\[:class:`str`]
286+
buttons: :class:`list`\[:class:`str`]
287287
A list of strings representing the labels of custom buttons shown in a rich presence.
288288
289289
.. versionadded:: 2.0
@@ -746,7 +746,7 @@ def title(self) -> str:
746746

747747
@property
748748
def artists(self) -> list[str]:
749-
""":class:`list`\\[:class:`str`]: The artists of the song being played."""
749+
r""":class:`list`\[:class:`str`]: The artists of the song being played."""
750750
return self._state.split("; ")
751751

752752
@property

disnake/app_commands.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def localize(self, store: LocalizationProtocol) -> None:
164164

165165

166166
class Option:
167-
"""Represents a slash command option.
167+
r"""Represents a slash command option.
168168
169169
Parameters
170170
----------
@@ -184,12 +184,12 @@ class Option:
184184
The option type, e.g. :class:`OptionType.user`.
185185
required: :class:`bool`
186186
Whether this option is required.
187-
choices: :class:`~collections.abc.Sequence`\\[:class:`OptionChoice`] | :class:`~collections.abc.Sequence`\\[:class:`str` | :class:`int` | :class:`float`] | :class:`~collections.abc.Mapping`\\[:class:`str`, :class:`str` | :class:`int` | :class:`float`]
187+
choices: :class:`~collections.abc.Sequence`\[:class:`OptionChoice`] | :class:`~collections.abc.Sequence`\[:class:`str` | :class:`int` | :class:`float`] | :class:`~collections.abc.Mapping`\[:class:`str`, :class:`str` | :class:`int` | :class:`float`]
188188
The pre-defined choices for this option.
189-
options: :class:`list`\\[:class:`Option`]
189+
options: :class:`list`\[:class:`Option`]
190190
The list of sub options. Normally you don't have to specify it directly,
191191
instead consider using ``@main_cmd.sub_command`` or ``@main_cmd.sub_command_group`` decorators.
192-
channel_types: :class:`list`\\[:class:`ChannelType`]
192+
channel_types: :class:`list`\[:class:`ChannelType`]
193193
The list of channel types that your option supports, if the type is :class:`OptionType.channel`.
194194
By default, it supports all channel types.
195195
autocomplete: :class:`bool`
@@ -218,12 +218,12 @@ class Option:
218218
The option type, e.g. :class:`OptionType.user`.
219219
required: :class:`bool`
220220
Whether this option is required.
221-
choices: :class:`list`\\[:class:`OptionChoice`]
221+
choices: :class:`list`\[:class:`OptionChoice`]
222222
The list of pre-defined choices.
223-
options: :class:`list`\\[:class:`Option`]
223+
options: :class:`list`\[:class:`Option`]
224224
The list of sub options. Normally you don't have to specify it directly,
225225
instead consider using ``@main_cmd.sub_command`` or ``@main_cmd.sub_command_group`` decorators.
226-
channel_types: :class:`list`\\[:class:`ChannelType`]
226+
channel_types: :class:`list`\[:class:`ChannelType`]
227227
The list of channel types that your option supports, if the type is :class:`OptionType.channel`.
228228
By default, it supports all channel types.
229229
autocomplete: :class:`bool`
@@ -1013,7 +1013,7 @@ def from_dict(cls, data: ApplicationCommandPayload) -> Self:
10131013

10141014

10151015
class SlashCommand(ApplicationCommand):
1016-
"""The base class for building slash commands.
1016+
r"""The base class for building slash commands.
10171017
10181018
Attributes
10191019
----------
@@ -1050,7 +1050,7 @@ class SlashCommand(ApplicationCommand):
10501050
10511051
.. versionadded:: 2.10
10521052
1053-
options: :class:`list`\\[:class:`Option`]
1053+
options: :class:`list`\[:class:`Option`]
10541054
The list of options the slash command has.
10551055
"""
10561056

@@ -1152,7 +1152,7 @@ def localize(self, store: LocalizationProtocol) -> None:
11521152

11531153

11541154
class APISlashCommand(SlashCommand, _APIApplicationCommandMixin):
1155-
"""A slash command returned by the API.
1155+
r"""A slash command returned by the API.
11561156
11571157
.. versionadded:: 2.4
11581158
@@ -1192,7 +1192,7 @@ class APISlashCommand(SlashCommand, _APIApplicationCommandMixin):
11921192
11931193
id: :class:`int`
11941194
The slash command's ID.
1195-
options: :class:`list`\\[:class:`Option`]
1195+
options: :class:`list`\[:class:`Option`]
11961196
The list of options the slash command has.
11971197
application_id: :class:`int`
11981198
The application ID this command belongs to.
@@ -1291,7 +1291,7 @@ def is_all_channels(self) -> bool:
12911291

12921292

12931293
class GuildApplicationCommandPermissions:
1294-
"""Represents application command permissions in a guild.
1294+
r"""Represents application command permissions in a guild.
12951295
12961296
.. versionchanged:: 2.5
12971297
Can now also represent application-wide permissions that apply to every command by default.
@@ -1304,7 +1304,7 @@ class GuildApplicationCommandPermissions:
13041304
The application ID this command belongs to.
13051305
guild_id: :class:`int`
13061306
The ID of the guild where these permissions are applied.
1307-
permissions: :class:`list`\\[:class:`ApplicationCommandPermissions`]
1307+
permissions: :class:`list`\[:class:`ApplicationCommandPermissions`]
13081308
A list of :class:`ApplicationCommandPermissions`.
13091309
"""
13101310

disnake/appinfo.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737

3838
class InstallParams:
39-
"""Represents the installation parameters for the application, provided by Discord.
39+
r"""Represents the installation parameters for the application, provided by Discord.
4040
4141
.. versionadded:: 2.5
4242
@@ -45,7 +45,7 @@ class InstallParams:
4545
4646
Attributes
4747
----------
48-
scopes: :class:`list`\\[:class:`str`]
48+
scopes: :class:`list`\[:class:`str`]
4949
The scopes requested by the application.
5050
permissions: :class:`Permissions`
5151
The permissions requested for the bot role.
@@ -163,7 +163,7 @@ def __repr__(self) -> str:
163163

164164

165165
class AppInfo:
166-
"""Represents the application info for the bot provided by Discord.
166+
r"""Represents the application info for the bot provided by Discord.
167167
168168
Attributes
169169
----------
@@ -186,7 +186,7 @@ class AppInfo:
186186
bot_require_code_grant: :class:`bool`
187187
Whether the bot requires the completion of the full oauth2 code
188188
grant flow to join.
189-
rpc_origins: :class:`list`\\[:class:`str`] | :data:`None`
189+
rpc_origins: :class:`list`\[:class:`str`] | :data:`None`
190190
A list of RPC origin URLs, if RPC is enabled.
191191
verify_key: :class:`str`
192192
The hex encoded key for verification in interactions and the
@@ -227,7 +227,7 @@ class AppInfo:
227227
228228
.. versionadded:: 2.3
229229
230-
tags: :class:`list`\\[:class:`str`] | :data:`None`
230+
tags: :class:`list`\[:class:`str`] | :data:`None`
231231
The application's tags.
232232
233233
.. versionadded:: 2.5
@@ -264,7 +264,7 @@ class AppInfo:
264264
The approximate number of users that have authorized the app with OAuth2.
265265
266266
.. versionadded:: 2.11
267-
redirect_uris: :class:`list`\\[:class:`str`] | :data:`None`
267+
redirect_uris: :class:`list`\[:class:`str`] | :data:`None`
268268
The application's OAuth2 redirect URIs.
269269
270270
.. versionadded:: 2.11
@@ -284,7 +284,7 @@ class AppInfo:
284284
285285
.. versionadded:: 2.11
286286
287-
event_webhooks_types: :class:`list`\\[:class:`str`] | :data:`None`
287+
event_webhooks_types: :class:`list`\[:class:`str`] | :data:`None`
288288
The application's event webhook types, if any.
289289
290290
.. versionadded:: 2.11
@@ -473,7 +473,7 @@ async def edit(
473473
event_webhooks_status: ApplicationEventWebhookStatus = MISSING,
474474
event_webhooks_types: Sequence[str] = MISSING,
475475
) -> AppInfo:
476-
"""|coro|
476+
r"""|coro|
477477
478478
Edit's the application's information.
479479
@@ -531,13 +531,13 @@ async def edit(
531531
Update the cover_image for rich presence integrations.
532532
interactions_endpoint_url: :class:`str` | :data:`None`
533533
The application's interactions endpoint URL.
534-
tags: :class:`list`\\[:class:`str`]
534+
tags: :class:`list`\[:class:`str`]
535535
The application's tags.
536536
event_webhooks_url: :class:`str` | :data:`None`
537537
The application's event webhooks URL.
538538
event_webhooks_status: :class:`ApplicationEventWebhookStatus`
539539
The application's event webhooks status.
540-
event_webhooks_types: :class:`list`\\[:class:`str`] | :data:`None`
540+
event_webhooks_types: :class:`list`\[:class:`str`] | :data:`None`
541541
The application's event webhook types. See `webhook event types <https://discord.com/developers/docs/events/webhook-events#event-types>`_
542542
for a list of valid events.
543543
@@ -644,7 +644,7 @@ async def edit(
644644

645645

646646
class PartialAppInfo:
647-
"""Represents a partial AppInfo given by :func:`~disnake.abc.GuildChannel.create_invite`.
647+
r"""Represents a partial AppInfo given by :func:`~disnake.abc.GuildChannel.create_invite`.
648648
649649
.. versionadded:: 2.0
650650
@@ -656,7 +656,7 @@ class PartialAppInfo:
656656
The application's name.
657657
description: :class:`str`
658658
The application's description.
659-
rpc_origins: :class:`list`\\[:class:`str`] | :data:`None`
659+
rpc_origins: :class:`list`\[:class:`str`] | :data:`None`
660660
A list of RPC origin URLs, if RPC is enabled.
661661
verify_key: :class:`str`
662662
The hex encoded key for verification in interactions and the

disnake/audit_logs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ class _AuditLogProxyKickOrMemberRoleAction:
518518

519519

520520
class AuditLogEntry(Hashable):
521-
"""Represents an Audit Log entry.
521+
r"""Represents an Audit Log entry.
522522
523523
You can retrieve these via :meth:`Guild.audit_logs`,
524524
or via the :func:`on_audit_log_entry_create` event.
@@ -545,7 +545,7 @@ class AuditLogEntry(Hashable):
545545
action: :class:`AuditLogAction`
546546
The action that was done.
547547
user: :class:`Member` | :class:`User` | :class:`Object` | :data:`None`
548-
The user who initiated this action. Usually :class:`Member`\\, unless gone
548+
The user who initiated this action. Usually :class:`Member`\, unless gone
549549
then it's a :class:`User`.
550550
551551
.. versionchanged:: 2.8

0 commit comments

Comments
 (0)