Skip to content

Commit

Permalink
no changes
Browse files Browse the repository at this point in the history
Commit was changed to original should not be in PR at all.
  • Loading branch information
Error44s authored Jan 4, 2025
1 parent 5c7faa1 commit a3d7501
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions discord/audit_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,13 +874,7 @@ def _convert_target_invite(self, target_id: None) -> Invite:
def _convert_target_emoji(self, target_id: int) -> Union[Emoji, Object]:
return self._state.get_emoji(target_id) or Object(id=target_id, type=Emoji)

def _convert_target_message(self, target_id: Optional[int]) -> Union[Member, User, Object, None]:
# Safeguard against target_id being None for actions like message_pin and message_unpin
if target_id is None:
# Handle the None case (provide a fallback Object or return None)
return Object(id=-1, type=Member) # Use a default ID like -1 if needed

# If target_id is not None, proceed normally
def _convert_target_message(self, target_id: int) -> Union[Member, User, Object]:
return self._get_member(target_id) or Object(id=target_id, type=Member)

def _convert_target_stage_instance(self, target_id: int) -> Union[StageInstance, Object]:
Expand Down

0 comments on commit a3d7501

Please sign in to comment.