aboutsummaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
authorAndres Torres <[email protected]>2020-09-04 05:42:31 -0700
committerGitHub <[email protected]>2020-09-04 08:42:31 -0400
commit39aa08ab937d4ef7d1f796fe611da9495ef5f949 (patch)
tree04377beebf8e919c5bacda39f192a400908e77eb /discord
parentDon't call close() if we've already been closed in Client.run (diff)
downloaddiscord.py-39aa08ab937d4ef7d1f796fe611da9495ef5f949.tar.xz
discord.py-39aa08ab937d4ef7d1f796fe611da9495ef5f949.zip
Added __eq__ to Message
Diffstat (limited to 'discord')
-rw-r--r--discord/message.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/discord/message.py b/discord/message.py
index e2cfe866..7e8440f4 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -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]