Skip to content

Commit

Permalink
Merge pull request #1355 from Middledot/audit-log-covers
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorukyum committed May 14, 2022
2 parents dd62cc3 + 347b92f commit fce0e87
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 fce0e87

Please sign in to comment.