From 5ffbe62b41af3097c36739878a832e254f75c9a6 Mon Sep 17 00:00:00 2001 From: Om <92863779+Om1609@users.noreply.github.com> Date: Fri, 10 Mar 2023 04:41:41 +0530 Subject: [PATCH] fix: pass `reason` to the correct method in AutoModRule (#1960) * Remove `reason` from being passed to AutoModRule Signed-off-by: Om <92863779+Om1609@users.noreply.github.com> * Update discord/guild.py Co-authored-by: plun1331 <49261529+plun1331@users.noreply.github.com> Signed-off-by: Om <92863779+Om1609@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update CHANGELOG.md Signed-off-by: Om <92863779+Om1609@users.noreply.github.com> * Update CHANGELOG.md Signed-off-by: BobDotCom <71356958+BobDotCom@users.noreply.github.com> --------- Signed-off-by: Om <92863779+Om1609@users.noreply.github.com> Signed-off-by: BobDotCom <71356958+BobDotCom@users.noreply.github.com> Co-authored-by: plun1331 <49261529+plun1331@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: BobDotCom <71356958+BobDotCom@users.noreply.github.com> --- CHANGELOG.md | 2 ++ discord/guild.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 619889f0c6..bfef80cd4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the voice ip discovery due to the recent [announced change](https://discord.com/channels/613425648685547541/697138785317814292/1080623873629884486). ([#1955](https://github.com/Pycord-Development/pycord/pull/1955)) +- Fixed `reason` being passed to wrong method in `guild.create_auto_moderation_rule`. + ([#1960](https://github.com/Pycord-Development/pycord/pull/1960)) ## [2.4.0] - 2023-02-10 diff --git a/discord/guild.py b/discord/guild.py index 465a6096dd..067f71ed39 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -3835,5 +3835,7 @@ async def create_auto_moderation_rule( if exempt_channels: payload["exempt_channels"] = [c.id for c in exempt_channels] - data = await self._state.http.create_auto_moderation_rule(self.id, payload) - return AutoModRule(state=self._state, data=data, reason=reason) + data = await self._state.http.create_auto_moderation_rule( + self.id, payload, reason=reason + ) + return AutoModRule(state=self._state, data=data)