diff --git a/discord/threads.py b/discord/threads.py index 10e91a571..1acf041cd 100644 --- a/discord/threads.py +++ b/discord/threads.py @@ -517,6 +517,7 @@ class Thread(Messageable, Hashable): pinned: bool = MISSING, slowmode_delay: int = MISSING, auto_archive_duration: ThreadArchiveDuration = MISSING, + reason: Optional[str] = None, ) -> Thread: """|coro| @@ -548,6 +549,8 @@ class Thread(Messageable, Hashable): slowmode_delay: :class:`int` Specifies the slowmode rate limit for user in this thread, in seconds. A value of ``0`` disables slowmode. The maximum value possible is ``21600``. + reason: Optional[:class:`str`] + The reason for editing this thread. Shows up on the audit log. Raises ------- @@ -579,7 +582,7 @@ class Thread(Messageable, Hashable): flags.pinned = pinned payload['flags'] = flags.value - data = await self._state.http.edit_channel(self.id, **payload) + data = await self._state.http.edit_channel(self.id, **payload, reason=reason) # The data payload will always be a Thread payload return Thread(data=data, state=self._state, guild=self.guild) # type: ignore