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

@@ -3335,7 +3335,13 @@ class Guild(Hashable):
return Widget(state=self._state, data=data)
async def edit_widget(self, *, enabled: bool = MISSING, channel: Optional[Snowflake] = MISSING) -> None:
async def edit_widget(
self,
*,
enabled: bool = MISSING,
channel: Optional[Snowflake] = MISSING,
reason: Optional[str] = None,
) -> None:
"""|coro|
Edits the widget of the guild.
@@ -3351,6 +3357,8 @@ class Guild(Hashable):
Whether to enable the widget for the guild.
channel: Optional[:class:`~discord.abc.Snowflake`]
The new widget channel. ``None`` removes the widget channel.
reason: Optional[:class:`str`]
The reason for editing this widget. Shows up on the audit log.
Raises
-------
@@ -3365,7 +3373,7 @@ class Guild(Hashable):
if enabled is not MISSING:
payload['enabled'] = enabled
await self._state.http.edit_widget(self.id, payload=payload)
await self._state.http.edit_widget(self.id, payload=payload, reason=reason)
async def chunk(self, *, cache: bool = True) -> Optional[List[Member]]:
"""|coro|