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

Add new AuditLogAction types #2427

Closed
wants to merge 10 commits into from
Closed

Add new AuditLogAction types #2427

wants to merge 10 commits into from

Conversation

bijij
Copy link
Contributor

@bijij bijij commented Nov 20, 2019

Summary

Adds new audit log entry types specified in discord/discord-api-docs#1191
Also fixes an issue with unknown audit log types with extra data causing an exception.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • [] This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • [] This PR is not a code change (e.g. documentation, README, ...)

Copy link
Contributor

@apple502j apple502j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments:

message_id = int(self.extra['message_id'])
elems = {
'channel': self.guild.get_channel(channel_id) or Object(id=channel_id),
'message_id': message_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly self.guild._state._get_message()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think so.
Audit logs aren't sent via WS events so there's no way to know when exactly to make a cache of the message.

discord/enums.py Outdated Show resolved Hide resolved
docs/api.rst Outdated Show resolved Hide resolved
docs/api.rst Outdated Show resolved Hide resolved
discord/audit_logs.py Show resolved Hide resolved
discord/audit_logs.py Outdated Show resolved Hide resolved
docs/api.rst Outdated Show resolved Hide resolved
docs/api.rst Outdated Show resolved Hide resolved
bijij and others added 4 commits November 20, 2019 17:46
Co-Authored-By: Modelmat <Modelmat@users.noreply.github.com>
Co-Authored-By: Modelmat <Modelmat@users.noreply.github.com>
@Jackenmen
Copy link
Contributor

It's not in description of this PR but it resolves #2426

@Rapptz Rapptz added the merged Tag to mark pull requests as rebased or merged label Nov 26, 2019
@Rapptz Rapptz closed this Nov 26, 2019
discord/enums.py Outdated
@@ -341,6 +353,9 @@ def category(self):
AuditLogAction.emoji_update: AuditLogActionCategory.update,
AuditLogAction.emoji_delete: AuditLogActionCategory.delete,
AuditLogAction.message_delete: AuditLogActionCategory.delete,
AuditLogAction.integration_create: AuditLogActionCategory.create,
AuditLogAction.integration_update: AuditLogActionCategoty.update,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have a mistype here,
AuditLogActionCategoty
Instead of
AuditLogActionCategory

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was already fixed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See f9b8b23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged Tag to mark pull requests as rebased or merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants