Skip to content

Commit a0c50d1

Browse files
authored
Merge pull request #727 from Ratery/master
Add reason kwarg to Thread.edit method
2 parents 1b17e83 + 4d34966 commit a0c50d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

discord/threads.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ async def edit(
526526
invitable: bool = MISSING,
527527
slowmode_delay: int = MISSING,
528528
auto_archive_duration: ThreadArchiveDuration = MISSING,
529+
reason: Optional[str] = None
529530
) -> Thread:
530531
"""|coro|
531532
@@ -555,6 +556,8 @@ async def edit(
555556
slowmode_delay: :class:`int`
556557
Specifies the slowmode rate limit for user in this thread, in seconds.
557558
A value of ``0`` disables slowmode. The maximum value possible is ``21600``.
559+
reason: Optional[:class:`str`]
560+
The reason for editing this thread. Shows up on the audit log.
558561
559562
Raises
560563
-------
@@ -582,7 +585,7 @@ async def edit(
582585
if slowmode_delay is not MISSING:
583586
payload['rate_limit_per_user'] = slowmode_delay
584587

585-
data = await self._state.http.edit_channel(self.id, **payload)
588+
data = await self._state.http.edit_channel(self.id, **payload, reason=reason)
586589
# The data payload will always be a Thread payload
587590
return Thread(data=data, state=self._state, guild=self.guild) # type: ignore
588591

0 commit comments

Comments
 (0)