aboutsummaryrefslogtreecommitdiff
path: root/discord/integrations.py
diff options
context:
space:
mode:
authorNadir Chowdhury <[email protected]>2021-07-29 00:54:32 +0100
committerGitHub <[email protected]>2021-07-28 19:54:32 -0400
commit96b9a0e09dd791885a9f7ca85c8ac8a66821ac20 (patch)
tree5304ecf80567ca9df7612d27b03e4c9b03fc95e0 /discord/integrations.py
parentAdd Number type (10) to Application Command Option types (diff)
downloaddiscord.py-96b9a0e09dd791885a9f7ca85c8ac8a66821ac20.tar.xz
discord.py-96b9a0e09dd791885a9f7ca85c8ac8a66821ac20.zip
Add reason kwarg to more methods
Diffstat (limited to 'discord/integrations.py')
-rw-r--r--discord/integrations.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/discord/integrations.py b/discord/integrations.py
index e2d6e116..fa1029bf 100644
--- a/discord/integrations.py
+++ b/discord/integrations.py
@@ -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):