From 79bd18f98cee59f0b93835b8e334096c8aab85c8 Mon Sep 17 00:00:00 2001 From: Vioshim <63890837+Vioshim@users.noreply.github.com> Date: Sun, 10 Apr 2022 21:51:24 -0500 Subject: [PATCH] Add reason parameter to Thread.edit --- discord/threads.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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