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

@@ -713,6 +713,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
type: Optional[ChannelType] = None,
reason: Optional[str] = None,
invitable: bool = True,
slowmode_delay: Optional[int] = None,
) -> Thread:
"""|coro|
@@ -743,6 +744,10 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
invitable: :class:`bool`
Whether non-modertators can add users to the thread. Only applicable to private threads.
Defaults to ``True``.
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``.
Raises
-------
@@ -768,6 +773,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
type=type.value,
reason=reason,
invitable=invitable,
rate_limit_per_user=slowmode_delay,
)
else:
data = await self._state.http.start_thread_with_message(
@@ -776,6 +782,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
name=name,
auto_archive_duration=auto_archive_duration or self.default_auto_archive_duration,
reason=reason,
rate_limit_per_user=slowmode_delay,
)
return Thread(guild=self.guild, state=self._state, data=data)