From 72b6b67cf473f6080bc6ae63dd5ba713b5f748bd Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 20 Mar 2019 22:54:53 -0400 Subject: [PATCH] Add back PartialEmoji.__hash__ that was deleted due to __eq__. --- discord/emoji.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discord/emoji.py b/discord/emoji.py index b9ead71b7..b87a7fd90 100644 --- a/discord/emoji.py +++ b/discord/emoji.py @@ -81,6 +81,9 @@ class PartialEmoji(namedtuple('PartialEmoji', 'animated name id')): if isinstance(other, (PartialEmoji, Emoji)): return self.id == other.id + def __hash__(self): + return hash((self.id, self.name)) + def is_custom_emoji(self): """Checks if this is a custom non-Unicode emoji.""" return self.id is not None