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

[ExtendedModLog] The cog doesn't check the changed roles in audit log event for member role update #251

Open
Jackenmen opened this issue Jul 13, 2021 · 0 comments

Comments

@Jackenmen
Copy link
Contributor

Describe the bug
The cog does not check what roles have been changed in the audit log entry which causes it to report incorrect "Updated by" and "Reason" in the logs it reports.

To Reproduce
Have multiple roles applied by different bots at the same time and hope the cog gets it mixed up? There are screenshots below of how that happened in my case.

Expected behavior
The audit log entry should be checked for the changed roles.

Screenshots
image
image
image

// What's up with these sections? 🤔 I'm using up-to-date Red and ExtendedModLog but I don't think you need to know my browser or smartphone :)

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

Here is how the above audit log entries look in d.py

(reprs of target and user simplified to just username in order to save space but they are regular discord.Member objects):

log.target = KING#0420
log.user = God of Numbers#3682
log.reason = 'Member verified with emoji reaction.'
log.before = <AuditLogDiff roles=[<Role id=589865098898702347 name='Unverified'>]>
log.after = <AuditLogDiff roles=[]>
log.extra = None

---

log.target = KING#0420
log.user = MEE6#4876
log.reason = None
log.before = <AuditLogDiff roles=[]>
log.after = <AuditLogDiff roles=[<Role id=431632746159538198 name='Humans'>]>
log.extra = None

---

log.target = KING#0420
log.user = God of Numbers#3682
log.reason = 'Sticky Roles'
log.before = <AuditLogDiff roles=[]>
log.after = <AuditLogDiff roles=[<Role id=587334671692464132 name='Lux Patron'>]>
log.extra = None

---

log.target = KING#0420
log.user = God of Numbers#3682
log.reason = 'New unverified member.'
log.before = <AuditLogDiff roles=[]>
log.after = <AuditLogDiff roles=[<Role id=589865098898702347 name='Unverified'>]>
log.extra = None

Additional notes
This is probably not the only event that should be checked for more than just the target, see the d.py documentation for more information:
https://discordpy.readthedocs.io/en/stable/api.html#discord.AuditLogAction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant