Add missing parameters to certain methods

- slowmode_delay and reason in Message.create_thread
- slowmode_delay in TextChannel.create_thread
- reason in Guild.edit_widget
This commit is contained in:
Stocker
2022-03-06 23:00:50 -05:00
committed by GitHub
parent 12d4de52a8
commit e15415413b
4 changed files with 39 additions and 5 deletions

View File

@@ -1595,7 +1595,14 @@ 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 = MISSING) -> Thread:
async def create_thread(
self,
*,
name: str,
auto_archive_duration: ThreadArchiveDuration = MISSING,
slowmode_delay: Optional[int] = None,
reason: Optional[str] = None,
) -> Thread:
"""|coro|
Creates a public thread from this message.
@@ -1614,6 +1621,12 @@ class Message(Hashable):
auto_archive_duration: :class:`int`
The duration in minutes before a thread is automatically archived for inactivity.
If not provided, the channel's default auto archive duration is used.
slowmode_delay: Optional[:class:`int`]
Specifies the slowmode rate limit for user in this channel, in seconds.
The maximum value possible is `21600`. By default no slowmode rate limit
if this is ``None``.
reason: Optional[:class:`str`]
The reason for creating a new thread. Shows up on the audit log.
Raises
-------
@@ -1638,6 +1651,8 @@ class Message(Hashable):
self.id,
name=name,
auto_archive_duration=auto_archive_duration or default_auto_archive_duration,
rate_limit_per_user=slowmode_delay,
reason=reason,
)
return Thread(guild=self.guild, state=self._state, data=data)