aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-12-21 19:20:48 -0500
committerRapptz <[email protected]>2017-12-21 19:20:48 -0500
commitda9828c41fa36603cbc94f789aa7c7fba0e05010 (patch)
tree0d396032b1748a04aa4157874e06d95e860c3d37
parentUpdate Emoji.url to point to the GIF version of the animated emoji. (diff)
downloaddiscord.py-da9828c41fa36603cbc94f789aa7c7fba0e05010.tar.xz
discord.py-da9828c41fa36603cbc94f789aa7c7fba0e05010.zip
Use the proper endpoint for removing your own reaction.
-rw-r--r--discord/http.py5
-rw-r--r--discord/message.py5
2 files changed, 9 insertions, 1 deletions
diff --git a/discord/http.py b/discord/http.py
index 7ec64d82..4469f9d4 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -386,6 +386,11 @@ class HTTPClient:
channel_id=channel_id, message_id=message_id, member_id=member_id, emoji=emoji)
return self.request(r, header_bypass_delay=0.25)
+ def remove_own_reaction(self, message_id, channel_id, emoji):
+ r = Route('DELETE', '/channels/{channel_id}/messages/{message_id}/reactions/{emoji}/@me',
+ channel_id=channel_id, message_id=message_id, emoji=emoji)
+ return self.request(r, header_bypass_delay=0.25)
+
def get_reaction_users(self, message_id, channel_id, emoji, limit, after=None):
r = Route('GET', '/channels/{channel_id}/messages/{message_id}/reactions/{emoji}',
channel_id=channel_id, message_id=message_id, emoji=emoji)
diff --git a/discord/message.py b/discord/message.py
index 15e7cfb5..8059647d 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -701,7 +701,10 @@ class Message:
else:
raise InvalidArgument('emoji argument must be str, Emoji, or Reaction not {.__class__.__name__}.'.format(emoji))
- yield from self._state.http.remove_reaction(self.id, self.channel.id, emoji, member.id)
+ if member.id == self._state.self_id:
+ yield from self._state.http.remove_own_reaction(self.id, self.channel.id, emoji)
+ else:
+ yield from self._state.http.remove_reaction(self.id, self.channel.id, emoji, member.id)
@asyncio.coroutine
def clear_reactions(self):