Skip to content

Commit 1424acf

Browse files
style(pre-commit): auto fixes from pre-commit.com hooks
1 parent 3679443 commit 1424acf

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ These changes are available on the `master` branch, but have not yet been releas
5757
([#2747](https://github.com/Pycord-Development/pycord/pull/2747))
5858
- Added `discord.Interaction.created_at`.
5959
([#2801](https://github.com/Pycord-Development/pycord/pull/2801))
60-
- Added `ThreadAutoArchiveDuration` enum to get thread archive duration more efficiently.
61-
([#2826](https://github.com/Pycord-Development/pycord/pull/2826))
60+
- Added `ThreadAutoArchiveDuration` enum to get thread archive duration more
61+
efficiently. ([#2826](https://github.com/Pycord-Development/pycord/pull/2826))
6262

6363
### Fixed
6464

discord/channel.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
InviteTarget,
4040
SortOrder,
4141
StagePrivacyLevel,
42+
ThreadAutoArchiveDuration,
4243
VideoQualityMode,
4344
VoiceRegion,
44-
ThreadAutoArchiveDuration,
4545
try_enum,
4646
)
4747
from .errors import ClientException, InvalidArgument
@@ -1085,7 +1085,9 @@ async def edit(
10851085
sync_permissions: bool = ...,
10861086
category: CategoryChannel | None = ...,
10871087
slowmode_delay: int = ...,
1088-
default_auto_archive_duration: ThreadArchiveDuration | ThreadAutoArchiveDuration = ...,
1088+
default_auto_archive_duration: (
1089+
ThreadArchiveDuration | ThreadAutoArchiveDuration
1090+
) = ...,
10891091
default_thread_slowmode_delay: int = ...,
10901092
default_sort_order: SortOrder = ...,
10911093
default_reaction_emoji: GuildEmoji | int | str | None = ...,
@@ -1177,9 +1179,11 @@ async def edit(self, *, reason=None, **options):
11771179

11781180
if "default_auto_archive_duration" in options:
11791181
default_auto_archive_duration = options["default_auto_archive_duration"]
1180-
options["default_auto_archive_duration"] = default_auto_archive_duration \
1181-
if isinstance(default_auto_archive_duration, (int, float)) \
1182+
options["default_auto_archive_duration"] = (
1183+
default_auto_archive_duration
1184+
if isinstance(default_auto_archive_duration, (int, float))
11821185
else default_auto_archive_duration.value
1186+
)
11831187

11841188
payload = await self._edit(options, reason=reason)
11851189
if payload is not None:
@@ -1329,7 +1333,9 @@ async def create_thread(
13291333
raise InvalidArgument("file parameter must be File")
13301334
files = [file]
13311335

1332-
if auto_archive_duration is not None and isinstance(auto_archive_duration, ThreadAutoArchiveDuration):
1336+
if auto_archive_duration is not None and isinstance(
1337+
auto_archive_duration, ThreadAutoArchiveDuration
1338+
):
13331339
auto_archive_duration = auto_archive_duration.value
13341340

13351341
try:

discord/enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"InteractionContextType",
7979
"PollLayoutType",
8080
"MessageReferenceType",
81-
"ThreadAutoArchiveDuration"
81+
"ThreadAutoArchiveDuration",
8282
)
8383

8484

discord/threads.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from typing import TYPE_CHECKING, Callable, Iterable
2929

3030
from .abc import Messageable, _purge_messages_helper
31-
from .enums import ChannelType, try_enum, ThreadAutoArchiveDuration
31+
from .enums import ChannelType, ThreadAutoArchiveDuration, try_enum
3232
from .errors import ClientException
3333
from .flags import ChannelFlags
3434
from .mixins import Hashable
@@ -602,7 +602,9 @@ async def edit(
602602
locked: bool = MISSING,
603603
invitable: bool = MISSING,
604604
slowmode_delay: int = MISSING,
605-
auto_archive_duration: ThreadAutoArchiveDuration | ThreadArchiveDuration = MISSING,
605+
auto_archive_duration: (
606+
ThreadAutoArchiveDuration | ThreadArchiveDuration
607+
) = MISSING,
606608
pinned: bool = MISSING,
607609
applied_tags: list[ForumTag] = MISSING,
608610
reason: str | None = None,
@@ -663,9 +665,11 @@ async def edit(
663665
if archived is not MISSING:
664666
payload["archived"] = archived
665667
if auto_archive_duration is not MISSING:
666-
payload["auto_archive_duration"] = auto_archive_duration.value \
667-
if isinstance(auto_archive_duration, ThreadAutoArchiveDuration) \
668+
payload["auto_archive_duration"] = (
669+
auto_archive_duration.value
670+
if isinstance(auto_archive_duration, ThreadAutoArchiveDuration)
668671
else auto_archive_duration
672+
)
669673
if locked is not MISSING:
670674
payload["locked"] = locked
671675
if invitable is not MISSING:

0 commit comments

Comments
 (0)