aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/client.py22
-rw-r--r--discord/http.py4
2 files changed, 26 insertions, 0 deletions
diff --git a/discord/client.py b/discord/client.py
index 7b836f30..d2fe4af3 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -1043,6 +1043,28 @@ class Client:
return [User(**user) for user in data]
@asyncio.coroutine
+ def clear_reactions(self, message):
+ """|coro|
+
+ Removes all the reactions from a given message.
+
+ You need Manage Messages permission to use this.
+
+ Parameters
+ -----------
+ message: :class:`Message`
+ The message to remove all reactions from.
+
+ Raises
+ --------
+ HTTPException
+ Removing the reactions failed.
+ Forbidden
+ You do not have the proper permissions to remove all the reactions.
+ """
+ yield from self.http.clear_reactions(message.id, message.channel.id)
+
+ @asyncio.coroutine
def send_message(self, destination, content=None, *, tts=False, embed=None):
"""|coro|
diff --git a/discord/http.py b/discord/http.py
index 1200be71..37b79c64 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -289,6 +289,10 @@ class HTTPClient:
params['after'] = after
return self.get(url, params=params, bucket='%s:%s' % (_func_(), channel_id))
+ def clear_reactions(self, message_id, channel_id):
+ url = '{0.CHANNELS}/{1}/messages/{2}/reactions'.format(self, channel_id, message_id)
+ return self.delete(url)
+
def get_message(self, channel_id, message_id):
url = '{0.CHANNELS}/{1}/messages/{2}'.format(self, channel_id, message_id)
return self.get(url, bucket=_func_())