diff --git a/CHANGELOG.md b/CHANGELOG.md index 45f8d1e2fc..d0fca146d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2194](https://github.com/Pycord-Development/pycord/pull/2194)) - Added support for custom bot status. ([#2206](https://github.com/Pycord-Development/pycord/pull/2206)) +- Added function `Guild.delete_auto_moderation_rule`. + ([#2153](https://github.com/Pycord-Development/pycord/pull/2153)) ### Changed diff --git a/discord/guild.py b/discord/guild.py index 2bd77b2dd5..5d74590dca 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -3816,3 +3816,29 @@ async def create_auto_moderation_rule( self.id, payload, reason=reason ) return AutoModRule(state=self._state, data=data) + + async def delete_auto_moderation_rule( + self, + id: int, + *, + reason: str | None = None, + ) -> None: + """ + Deletes an auto moderation rule. + + Parameters + ---------- + id: :class:`int` + The ID of the auto moderation rule. + reason: Optional[:class:`str`] + The reason for deleting the rule. Shows up in the audit log. + + Raises + ------ + HTTPException + Deleting the auto moderation rule failed. + Forbidden + You do not have the Manage Guild permission. + """ + + await self._state.http.delete_auto_moderation_rule(self.id, id, reason=reason)