aboutsummaryrefslogtreecommitdiff
path: root/discord/emoji.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-07-02 01:43:33 -0400
committerRapptz <[email protected]>2017-07-02 01:43:45 -0400
commit8caa088d259b8640ed6429bc21bdebebf8443c74 (patch)
tree6acd019a2b47408ed4b233e8c6add34f2a050630 /discord/emoji.py
parentFix Message.remove_reaction and Message.add_reaction taking in Reaction (diff)
downloaddiscord.py-8caa088d259b8640ed6429bc21bdebebf8443c74.tar.xz
discord.py-8caa088d259b8640ed6429bc21bdebebf8443c74.zip
Allow PartialReactionEmoji in add_reaction and remove_reaction.
Diffstat (limited to 'discord/emoji.py')
-rw-r--r--discord/emoji.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/emoji.py b/discord/emoji.py
index 0c161c6c..a959bea8 100644
--- a/discord/emoji.py
+++ b/discord/emoji.py
@@ -80,6 +80,11 @@ class PartialReactionEmoji(namedtuple('PartialReactionEmoji', 'name id')):
"""Checks if this is a Unicode emoji."""
return self.id is None
+ def _as_reaction(self):
+ if self.id is None:
+ return self.name
+ return ':%s:%s' % (self.name, self.id)
+
class Emoji(Hashable):
"""Represents a custom emoji.