Added __eq__ to Message

This commit is contained in:
Andres Torres
2020-09-04 05:42:31 -07:00
committed by GitHub
parent dce653a0eb
commit 39aa08ab93
2 changed files with 12 additions and 0 deletions

View File

@ -347,6 +347,9 @@ class Message:
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)
def __eq__(self, other):
return isinstance(other, self.__class__) and self.id == other.id
def _try_patch(self, data, key, transform=None):
try:
value = data[key]