Skip to content

Commit be7b9bf

Browse files
committed
feat: Apply changes and add doc
1 parent bd5c404 commit be7b9bf

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

discord/channel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
SortOrder,
4141
StagePrivacyLevel,
4242
)
43-
from .enums import ThreadArchiveDuration as ThreadAutoArchiveDuration
43+
from .enums import ThreadArchiveDuration as ThreadArchiveDurationEnum
4444
from .enums import (
4545
VideoQualityMode,
4646
VoiceRegion,
@@ -1088,7 +1088,7 @@ async def edit(
10881088
category: CategoryChannel | None = ...,
10891089
slowmode_delay: int = ...,
10901090
default_auto_archive_duration: (
1091-
ThreadArchiveDuration | ThreadAutoArchiveDuration
1091+
ThreadArchiveDuration | ThreadArchiveDurationEnum
10921092
) = ...,
10931093
default_thread_slowmode_delay: int = ...,
10941094
default_sort_order: SortOrder = ...,

discord/enums.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
from __future__ import annotations
2727

28-
import enum
28+
from enum import IntEnum
2929
import types
3030
from collections import namedtuple
3131
from typing import TYPE_CHECKING, Any, ClassVar, TypeVar, Union
@@ -1080,7 +1080,7 @@ class SubscriptionStatus(Enum):
10801080
inactive = 2
10811081

10821082

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

10861086
one_hour = 60

discord/threads.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
from .abc import Messageable, _purge_messages_helper
3131
from .enums import ChannelType
32-
from .enums import ThreadArchiveDuration as ThreadAutoArchiveDuration
32+
from .enums import ThreadArchiveDuration as ThreadArchiveDurationEnum
3333
from .enums import try_enum
3434
from .errors import ClientException
3535
from .flags import ChannelFlags
@@ -605,7 +605,7 @@ async def edit(
605605
invitable: bool = MISSING,
606606
slowmode_delay: int = MISSING,
607607
auto_archive_duration: (
608-
ThreadAutoArchiveDuration | ThreadArchiveDuration
608+
ThreadArchiveDurationEnum | ThreadArchiveDuration
609609
) = MISSING,
610610
pinned: bool = MISSING,
611611
applied_tags: list[ForumTag] = MISSING,

docs/api/enums.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,3 +2519,26 @@ of :class:`enum.Enum`.
25192519
.. attribute:: inactive
25202520
25212521
The subscription is inactive and the subscription owner is not being charged.
2522+
2523+
2524+
.. class:: ThreadArchiveDuration
2525+
2526+
Represents times before a thread is archived.
2527+
2528+
.. versionadded:: 2.7
2529+
2530+
.. attribute:: one_hour
2531+
2532+
Indicates that the thread will be archived after 1 hour of inactivity.
2533+
2534+
.. attribute:: one_day
2535+
2536+
Indicates that the thread will be archived after 1 day of inactivity.
2537+
2538+
.. attribute:: three_days
2539+
2540+
Indicates that the thread will be archived after 3 days of inactivity.
2541+
2542+
.. attribute:: one_week
2543+
2544+
Indicates that the thread will be archived after 1 week of inactivity.

0 commit comments

Comments
 (0)