mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-04 08:56:19 +00:00
Add reason kwarg to more methods
This commit is contained in:
@ -127,7 +127,7 @@ class Integration:
|
||||
self.user = User(state=self._state, data=user) if user else None
|
||||
self.enabled: bool = data['enabled']
|
||||
|
||||
async def delete(self) -> None:
|
||||
async def delete(self, *, reason: Optional[str] = None) -> None:
|
||||
"""|coro|
|
||||
|
||||
Deletes the integration.
|
||||
@ -135,6 +135,13 @@ class Integration:
|
||||
You must have the :attr:`~Permissions.manage_guild` permission to
|
||||
do this.
|
||||
|
||||
Parameters
|
||||
-----------
|
||||
reason: :class:`str`
|
||||
The reason the integration was deleted. Shows up on the audit log.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
Raises
|
||||
-------
|
||||
Forbidden
|
||||
@ -142,7 +149,7 @@ class Integration:
|
||||
HTTPException
|
||||
Deleting the integration failed.
|
||||
"""
|
||||
await self._state.http.delete_integration(self.guild.id, self.id)
|
||||
await self._state.http.delete_integration(self.guild.id, self.id, reason=reason)
|
||||
|
||||
|
||||
class StreamIntegration(Integration):
|
||||
|
Reference in New Issue
Block a user