diff options
| author | James Gayfer <[email protected]> | 2021-08-18 02:12:40 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-08-18 05:12:40 -0400 |
| commit | 489e5f3288efb9b9e6649447209e1ac1746ccb32 (patch) | |
| tree | aebf923100c377a41b6a762fec06509a65205fcf /discord/message.py | |
| parent | Fix some type hints in user.py (diff) | |
| download | discord.py-489e5f3288efb9b9e6649447209e1ac1746ccb32.tar.xz discord.py-489e5f3288efb9b9e6649447209e1ac1746ccb32.zip | |
Use channel default auto archive duration
Currently creating a new thread uses a default auto archive duration of
1440 minutes, or 1 day.
Rather than prescribing our own default, we can use the default auto
archive duration that is set on the channel. This ensures that newly
created threads will respect the default auto archive duration as
prescribed by the user.
Diffstat (limited to 'discord/message.py')
| -rw-r--r-- | discord/message.py | 6 |
1 files changed, 3 insertions, 3 deletions
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 |