Skip to content

Commit

Permalink
Fix attachment is_spoiler() and is_voice_message()
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfies committed Mar 3, 2025
1 parent fbe2b35 commit 61a2c30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ def flags(self) -> AttachmentFlags:

def is_spoiler(self) -> bool:
""":class:`bool`: Whether this attachment contains a spoiler."""
return self.filename.startswith('SPOILER_')
return self.filename.startswith('SPOILER_') or self.flags.spoiler

def is_voice_message(self) -> bool:
""":class:`bool`: Whether this attachment is a voice message."""
return self.duration is not None and 'voice-message' in self.url
return self.duration is not None and self.waveform is not None

def __repr__(self) -> str:
return f'<Attachment id={self.id} filename={self.filename!r} url={self.url!r}>'
Expand Down

0 comments on commit 61a2c30

Please sign in to comment.