Skip to content

Commit 703dfc9

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 529fc3a commit 703dfc9

Some content is hidden

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

88 files changed

+942
-471
lines changed

discord/abc.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,14 @@ class User(Snowflake, Protocol):
229229

230230
@property
231231
def display_name(self) -> str:
232-
"""Returns the user's display name."""
232+
"""Returns the user's display name.
233+
"""
233234
raise NotImplementedError
234235

235236
@property
236237
def mention(self) -> str:
237-
"""Returns a string that allows you to mention the given user."""
238+
"""Returns a string that allows you to mention the given user.
239+
"""
238240
raise NotImplementedError
239241

240242

@@ -544,7 +546,8 @@ def changed_roles(self) -> list[Role]:
544546

545547
@property
546548
def mention(self) -> str:
547-
"""The string that allows you to mention the channel."""
549+
"""The string that allows you to mention the channel.
550+
"""
548551
return f"<#{self.id}>"
549552

550553
@property
@@ -557,7 +560,8 @@ def jump_url(self) -> str:
557560

558561
@property
559562
def created_at(self) -> datetime:
560-
"""Returns the channel's creation time in UTC."""
563+
"""Returns the channel's creation time in UTC.
564+
"""
561565
return utils.snowflake_time(self.id)
562566

563567
def overwrites_for(self, obj: Role | User) -> PermissionOverwrite:

discord/activity.py

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ def to_dict(self) -> dict[str, Any]:
279279

280280
@property
281281
def start(self) -> datetime.datetime | None:
282-
"""When the user started doing this activity in UTC, if applicable."""
282+
"""When the user started doing this activity in UTC, if applicable.
283+
"""
283284
try:
284285
timestamp = self.timestamps["start"] / 1000
285286
except KeyError:
@@ -289,7 +290,8 @@ def start(self) -> datetime.datetime | None:
289290

290291
@property
291292
def end(self) -> datetime.datetime | None:
292-
"""When the user will stop doing this activity in UTC, if applicable."""
293+
"""When the user will stop doing this activity in UTC, if applicable.
294+
"""
293295
try:
294296
timestamp = self.timestamps["end"] / 1000
295297
except KeyError:
@@ -299,7 +301,8 @@ def end(self) -> datetime.datetime | None:
299301

300302
@property
301303
def large_image_url(self) -> str | None:
302-
"""Returns a URL pointing to the large image asset of this activity if applicable."""
304+
"""Returns a URL pointing to the large image asset of this activity if applicable.
305+
"""
303306
if self.application_id is None:
304307
return None
305308

@@ -312,7 +315,8 @@ def large_image_url(self) -> str | None:
312315

313316
@property
314317
def small_image_url(self) -> str | None:
315-
"""Returns a URL pointing to the small image asset of this activity if applicable."""
318+
"""Returns a URL pointing to the small image asset of this activity if applicable.
319+
"""
316320
if self.application_id is None:
317321
return None
318322

@@ -325,12 +329,14 @@ def small_image_url(self) -> str | None:
325329

326330
@property
327331
def large_image_text(self) -> str | None:
328-
"""Returns the large image asset hover text of this activity if applicable."""
332+
"""Returns the large image asset hover text of this activity if applicable.
333+
"""
329334
return self.assets.get("large_text", None)
330335

331336
@property
332337
def small_image_text(self) -> str | None:
333-
"""Returns the small image asset hover text of this activity if applicable."""
338+
"""Returns the small image asset hover text of this activity if applicable.
339+
"""
334340
return self.assets.get("small_text", None)
335341

336342

@@ -393,7 +399,8 @@ def type(self) -> ActivityType:
393399

394400
@property
395401
def start(self) -> datetime.datetime | None:
396-
"""When the user started playing this game in UTC, if applicable."""
402+
"""When the user started playing this game in UTC, if applicable.
403+
"""
397404
if self._start:
398405
return datetime.datetime.fromtimestamp(
399406
self._start / 1000, tz=datetime.timezone.utc
@@ -402,7 +409,8 @@ def start(self) -> datetime.datetime | None:
402409

403410
@property
404411
def end(self) -> datetime.datetime | None:
405-
"""When the user will stop playing this game in UTC, if applicable."""
412+
"""When the user will stop playing this game in UTC, if applicable.
413+
"""
406414
if self._end:
407415
return datetime.datetime.fromtimestamp(
408416
self._end / 1000, tz=datetime.timezone.utc
@@ -643,7 +651,8 @@ def to_dict(self) -> dict[str, Any]:
643651

644652
@property
645653
def name(self) -> str:
646-
"""The activity's name. This will always return "Spotify"."""
654+
"""The activity's name. This will always return "Spotify".
655+
"""
647656
return "Spotify"
648657

649658
def __eq__(self, other: Any) -> bool:
@@ -671,12 +680,14 @@ def __repr__(self) -> str:
671680

672681
@property
673682
def title(self) -> str:
674-
"""The title of the song being played."""
683+
"""The title of the song being played.
684+
"""
675685
return self._details
676686

677687
@property
678688
def artists(self) -> list[str]:
679-
"""The artists of the song being played."""
689+
"""The artists of the song being played.
690+
"""
680691
return self._state.split("; ")
681692

682693
@property
@@ -690,12 +701,14 @@ def artist(self) -> str:
690701

691702
@property
692703
def album(self) -> str:
693-
"""The album that the song being played belongs to."""
704+
"""The album that the song being played belongs to.
705+
"""
694706
return self._assets.get("large_text", "")
695707

696708
@property
697709
def album_cover_url(self) -> str:
698-
"""The album cover image URL from Spotify's CDN."""
710+
"""The album cover image URL from Spotify's CDN.
711+
"""
699712
large_image = self._assets.get("large_image", "")
700713
if large_image[:8] != "spotify:":
701714
return ""
@@ -704,7 +717,8 @@ def album_cover_url(self) -> str:
704717

705718
@property
706719
def track_id(self) -> str:
707-
"""The track ID used by Spotify to identify this song."""
720+
"""The track ID used by Spotify to identify this song.
721+
"""
708722
return self._sync_id
709723

710724
@property
@@ -717,26 +731,30 @@ def track_url(self) -> str:
717731

718732
@property
719733
def start(self) -> datetime.datetime:
720-
"""When the user started playing this song in UTC."""
734+
"""When the user started playing this song in UTC.
735+
"""
721736
return datetime.datetime.fromtimestamp(
722737
self._timestamps["start"] / 1000, tz=datetime.timezone.utc
723738
)
724739

725740
@property
726741
def end(self) -> datetime.datetime:
727-
"""When the user will stop playing this song in UTC."""
742+
"""When the user will stop playing this song in UTC.
743+
"""
728744
return datetime.datetime.fromtimestamp(
729745
self._timestamps["end"] / 1000, tz=datetime.timezone.utc
730746
)
731747

732748
@property
733749
def duration(self) -> datetime.timedelta:
734-
"""The duration of the song being played."""
750+
"""The duration of the song being played.
751+
"""
735752
return self.end - self.start
736753

737754
@property
738755
def party_id(self) -> str:
739-
"""The party ID of the listening party."""
756+
"""The party ID of the listening party.
757+
"""
740758
return self._party.get("id", "")
741759

742760

discord/appinfo.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ def __repr__(self) -> str:
171171

172172
@property
173173
def icon(self) -> Asset | None:
174-
"""Retrieves the application's icon asset, if any."""
174+
"""Retrieves the application's icon asset, if any.
175+
"""
175176
if self._icon is None:
176177
return None
177178
return Asset._from_icon(self._state, self.id, self._icon, path="app")
@@ -253,7 +254,8 @@ def __repr__(self) -> str:
253254

254255
@property
255256
def icon(self) -> Asset | None:
256-
"""Retrieves the application's icon asset, if any."""
257+
"""Retrieves the application's icon asset, if any.
258+
"""
257259
if self._icon is None:
258260
return None
259261
return Asset._from_icon(self._state, self.id, self._icon, path="app")

discord/asset.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,19 @@ def __hash__(self):
288288

289289
@property
290290
def url(self) -> str:
291-
"""Returns the underlying URL of the asset."""
291+
"""Returns the underlying URL of the asset.
292+
"""
292293
return self._url
293294

294295
@property
295296
def key(self) -> str:
296-
"""Returns the identifying key of the asset."""
297+
"""Returns the identifying key of the asset.
298+
"""
297299
return self._key
298300

299301
def is_animated(self) -> bool:
300-
"""Returns whether the asset is animated."""
302+
"""Returns whether the asset is animated.
303+
"""
301304
return self._animated
302305

303306
def replace(

discord/audit_logs.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,8 @@ def __repr__(self) -> str:
528528

529529
@utils.cached_property
530530
def created_at(self) -> datetime.datetime:
531-
"""Returns the entry's creation time in UTC."""
531+
"""Returns the entry's creation time in UTC.
532+
"""
532533
return utils.snowflake_time(self.id)
533534

534535
@utils.cached_property
@@ -557,24 +558,28 @@ def target(
557558

558559
@utils.cached_property
559560
def category(self) -> enums.AuditLogActionCategory:
560-
"""The category of the action, if applicable."""
561+
"""The category of the action, if applicable.
562+
"""
561563
return self.action.category
562564

563565
@utils.cached_property
564566
def changes(self) -> AuditLogChanges:
565-
"""The list of changes this entry has."""
567+
"""The list of changes this entry has.
568+
"""
566569
obj = AuditLogChanges(self, self._changes, state=self._state)
567570
del self._changes
568571
return obj
569572

570573
@utils.cached_property
571574
def before(self) -> AuditLogDiff:
572-
"""The target's prior state."""
575+
"""The target's prior state.
576+
"""
573577
return self.changes.before
574578

575579
@utils.cached_property
576580
def after(self) -> AuditLogDiff:
577-
"""The target's subsequent state."""
581+
"""The target's subsequent state.
582+
"""
578583
return self.changes.after
579584

580585
def _convert_target_guild(self, target_id: int) -> Guild:

discord/automod.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,14 @@ def __str__(self) -> str:
334334

335335
@cached_property
336336
def guild(self) -> Guild | None:
337-
"""The guild this rule belongs to."""
337+
"""The guild this rule belongs to.
338+
"""
338339
return self._state._get_guild(self.guild_id)
339340

340341
@cached_property
341342
def creator(self) -> Member | None:
342-
"""The member who created this rule."""
343+
"""The member who created this rule.
344+
"""
343345
if self.guild is None:
344346
return None
345347
return self.guild.get_member(self.creator_id)

0 commit comments

Comments
 (0)