Skip to content

Commit

Permalink
Support event covers for audit logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Middledot committed May 13, 2022
1 parent 028dd27 commit 347b92f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions discord/audit_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ def _transform_avatar(entry: AuditLogEntry, data: Optional[str]) -> Optional[Ass
return Asset._from_avatar(entry._state, entry._target_id, data) # type: ignore


def _transform_scheduled_event_cover(entry: AuditLogEntry, data: Optional[str]) -> Optional[Asset]:
if data is None:
return None
return Asset._from_scheduled_event_cover(entry._state, entry._target_id, data)


def _guild_hash_transformer(
path: str,
) -> Callable[[AuditLogEntry, Optional[str]], Optional[Asset]]:
Expand Down Expand Up @@ -239,6 +245,7 @@ class AuditLogChanges:
_enum_transformer(enums.ScheduledEventLocationType),
),
"command_id": ("command_id", _transform_snowflake),
"image_hash": ("cover", _transform_scheduled_event_cover),
}

def __init__(
Expand Down

0 comments on commit 347b92f

Please sign in to comment.