-
-
Notifications
You must be signed in to change notification settings - Fork 467
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 audit log overwrite transformer #1716
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1716 +/- ##
=======================================
Coverage 33.19% 33.19%
=======================================
Files 96 96
Lines 18414 18414
=======================================
Hits 6113 6113
Misses 12301 12301
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
BobDotCom
approved these changes
Oct 20, 2022
BobDotCom
requested review from
a team,
FrostByte266,
plun1331 and
WhoIsConch
and removed request for
a team
October 21, 2022 15:17
Lulalaby
approved these changes
Oct 21, 2022
plun1331
approved these changes
Oct 22, 2022
Lulalaby
approved these changes
Oct 22, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
A bit of a niche issue I encountered in help channels, but worth fixing nonetheless.
When fetching
audit_logs
from a guild, eachAuditLogEntry
can havebefore
/after
attributes showing the changes in thetarget
. Some Audit Log Actions can have anoverwrites
attribute if it deals with permissions, e.g. channel creation/deletion. When forming this attribute, the data from Discord goes through the below transformer to resolve the User/Role objects.pycord/discord/audit_logs.py
Lines 100 to 122 in 5e445b3
However, in the Overwrite structuer
"type"
is an integer; as such, the above code will always result intarget = None
, so the object is never resolved. This PR adjusts them to compare toint
s instead.Information
examples, ...).
Checklist
type: ignore
comments were used, a comment is also left explaining why.