Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass reason to the correct method in AutoModRule #1960

Merged
merged 7 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)