Skip to content

Commit

Permalink
fix: pass reason to the correct method in AutoModRule (#1960)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
4 people authored Mar 9, 2023
1 parent e787326 commit 010116d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,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

Expand Down
6 changes: 4 additions & 2 deletions discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 010116d

Please sign in to comment.