Skip to content

Commit 5ffbe62

Browse files
OmLankeplun1331pre-commit-ci[bot]BobDotCom
committed
fix: pass reason to the correct method in AutoModRule (#1960)
* Remove `reason` from being passed to AutoModRule Signed-off-by: Om <[email protected]> * Update discord/guild.py Co-authored-by: plun1331 <[email protected]> Signed-off-by: Om <[email protected]> * [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 <[email protected]> * Update CHANGELOG.md Signed-off-by: BobDotCom <[email protected]> --------- Signed-off-by: Om <[email protected]> Signed-off-by: BobDotCom <[email protected]> Co-authored-by: plun1331 <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: BobDotCom <[email protected]>
1 parent 6a8ee11 commit 5ffbe62

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ These changes are available on the `master` branch, but have not yet been releas
2323
- Fixed the voice ip discovery due to the recent
2424
[announced change](https://discord.com/channels/613425648685547541/697138785317814292/1080623873629884486).
2525
([#1955](https://github.com/Pycord-Development/pycord/pull/1955))
26+
- Fixed `reason` being passed to wrong method in `guild.create_auto_moderation_rule`.
27+
([#1960](https://github.com/Pycord-Development/pycord/pull/1960))
2628

2729
## [2.4.0] - 2023-02-10
2830

discord/guild.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3835,5 +3835,7 @@ async def create_auto_moderation_rule(
38353835
if exempt_channels:
38363836
payload["exempt_channels"] = [c.id for c in exempt_channels]
38373837

3838-
data = await self._state.http.create_auto_moderation_rule(self.id, payload)
3839-
return AutoModRule(state=self._state, data=data, reason=reason)
3838+
data = await self._state.http.create_auto_moderation_rule(
3839+
self.id, payload, reason=reason
3840+
)
3841+
return AutoModRule(state=self._state, data=data)

0 commit comments

Comments
 (0)