Skip to content

Commit 3747633

Browse files
committed
feat: make change after speak on github
1 parent a7d46af commit 3747633

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

discord/channel.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
InviteTarget,
4040
SortOrder,
4141
StagePrivacyLevel,
42-
ThreadAutoArchiveDuration,
4342
VideoQualityMode,
4443
VoiceRegion,
4544
try_enum,
4645
)
46+
from .enums import ThreadArchiveDuration as ThreadAutoArchiveDuration
4747
from .errors import ClientException, InvalidArgument
4848
from .file import File
4949
from .flags import ChannelFlags
@@ -1133,7 +1133,7 @@ async def edit(self, *, reason=None, **options):
11331133
default_auto_archive_duration: :class:`int`
11341134
The new default auto archive duration in minutes for threads created in this channel.
11351135
Must be one of ``60``, ``1440``, ``4320``, or ``10080``.
1136-
**ThreadAutoArchiveDuration** enum can be used for better understanding.
1136+
:class:`ThreadAutoArchiveDuration` can be used alternatively.
11371137
default_thread_slowmode_delay: :class:`int`
11381138
The new default slowmode delay in seconds for threads created in this channel.
11391139
@@ -1177,14 +1177,6 @@ async def edit(self, *, reason=None, **options):
11771177
options["flags"] = ChannelFlags._from_value(self.flags.value)
11781178
options["flags"].require_tag = options.pop("require_tag")
11791179

1180-
if "default_auto_archive_duration" in options:
1181-
default_auto_archive_duration = options["default_auto_archive_duration"]
1182-
options["default_auto_archive_duration"] = (
1183-
default_auto_archive_duration
1184-
if isinstance(default_auto_archive_duration, (int, float))
1185-
else default_auto_archive_duration.value
1186-
)
1187-
11881180
payload = await self._edit(options, reason=reason)
11891181
if payload is not None:
11901182
# the payload will always be the proper channel payload

discord/enums.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"InteractionContextType",
8080
"PollLayoutType",
8181
"MessageReferenceType",
82-
"ThreadAutoArchiveDuration",
82+
"ThreadArchiveDuration",
8383
)
8484

8585

@@ -1080,7 +1080,7 @@ class SubscriptionStatus(Enum):
10801080
inactive = 2
10811081

10821082

1083-
class ThreadAutoArchiveDuration(enum.IntEnum):
1083+
class ThreadArchiveDuration(enum.IntEnum):
10841084
"""Time set before the thread is auto archived"""
10851085

10861086
one_hour = 60

discord/threads.py

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

3030
from .abc import Messageable, _purge_messages_helper
31-
from .enums import ChannelType, ThreadAutoArchiveDuration, try_enum
31+
from .enums import ChannelType, try_enum
32+
from .enums import ThreadArchiveDuration as ThreadAutoArchiveDuration
3233
from .errors import ClientException
3334
from .flags import ChannelFlags
3435
from .mixins import Hashable
@@ -634,7 +635,7 @@ async def edit(
634635
auto_archive_duration: :class:`int`
635636
The new duration in minutes before a thread is automatically archived for inactivity.
636637
Must be one of ``60``, ``1440``, ``4320``, or ``10080``.
637-
**ThreadAutoArchiveDuration** enum can be used for better understanding.
638+
:class:`ThreadAutoArchiveDuration` can be used alternatively.
638639
slowmode_delay: :class:`int`
639640
Specifies the slowmode rate limit for user in this thread, in seconds.
640641
A value of ``0`` disables slowmode. The maximum value possible is ``21600``.

0 commit comments

Comments
 (0)