int() support

This commit is contained in:
iDutchy
2020-10-17 19:14:51 -05:00
parent 24839be99d
commit 09168d880f
8 changed files with 25 additions and 1 deletions

View File

@@ -84,6 +84,9 @@ class Attachment:
""":class:`bool`: Whether this attachment contains a spoiler."""
return self.filename.startswith('SPOILER_')
def __int__(self):
return self.id
def __repr__(self):
return '<Attachment id={0.id} filename={0.filename!r} url={0.url!r}>'.format(self)
@@ -388,6 +391,9 @@ class Message:
def __str__(self):
return self.content
def __int__(self):
return self.id
def __repr__(self):
return '<Message id={0.id} channel={0.channel!r} type={0.type!r} author={0.author!r} flags={0.flags!r}>'.format(self)