aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/channel.py8
-rw-r--r--discord/message.py6
2 files changed, 7 insertions, 7 deletions
diff --git a/discord/channel.py b/discord/channel.py
index ea7179b9..47e2c113 100644
--- a/discord/channel.py
+++ b/discord/channel.py
@@ -662,7 +662,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
*,
name: str,
message: Optional[Snowflake] = None,
- auto_archive_duration: ThreadArchiveDuration = 1440,
+ auto_archive_duration: ThreadArchiveDuration = MISSING,
type: Optional[ChannelType] = None,
reason: Optional[str] = None,
) -> Thread:
@@ -692,7 +692,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
Defaults to ``None``.
auto_archive_duration: :class:`int`
The duration in minutes before a thread is automatically archived for inactivity.
- Defaults to ``1440`` or 24 hours.
+ If not provided, the channel's default auto archive duration is used.
type: Optional[:class:`ChannelType`]
The type of thread to create. If a ``message`` is passed then this parameter
is ignored, as a thread created with a message is always a public thread.
@@ -720,7 +720,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
data = await self._state.http.start_thread_without_message(
self.id,
name=name,
- auto_archive_duration=auto_archive_duration,
+ auto_archive_duration=auto_archive_duration or self.default_auto_archive_duration,
type=type.value,
reason=reason,
)
@@ -729,7 +729,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
self.id,
message.id,
name=name,
- auto_archive_duration=auto_archive_duration,
+ auto_archive_duration=auto_archive_duration or self.default_auto_archive_duration,
reason=reason,
)
diff --git a/discord/message.py b/discord/message.py
index a0842d58..003232b5 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -1484,7 +1484,7 @@ class Message(Hashable):
"""
await self._state.http.clear_reactions(self.channel.id, self.id)
- async def create_thread(self, *, name: str, auto_archive_duration: ThreadArchiveDuration = 1440) -> Thread:
+ async def create_thread(self, *, name: str, auto_archive_duration: ThreadArchiveDuration = MISSING) -> Thread:
"""|coro|
Creates a public thread from this message.
@@ -1502,7 +1502,7 @@ class Message(Hashable):
The name of the thread.
auto_archive_duration: :class:`int`
The duration in minutes before a thread is automatically archived for inactivity.
- Defaults to ``1440`` or 24 hours.
+ If not provided, the channel's default auto archive duration is used.
Raises
-------
@@ -1525,7 +1525,7 @@ class Message(Hashable):
self.channel.id,
self.id,
name=name,
- auto_archive_duration=auto_archive_duration,
+ auto_archive_duration=auto_archive_duration or self.channel.default_auto_archive_duration,
)
return Thread(guild=self.guild, state=self._state, data=data) # type: ignore