mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-18 23:15:48 +00:00
Add reason parameter to Thread.edit
This commit is contained in:
parent
c568ed8cdc
commit
79bd18f98c
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user