aboutsummaryrefslogtreecommitdiff
path: root/discord/reaction.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2020-01-17 19:48:46 -0500
committerRapptz <[email protected]>2020-01-17 19:53:28 -0500
commit87f9dcff9c5af9c4fa6e6b148663320522a3c82f (patch)
tree2a46dc76aafa9e10ad134c681705684bdb4cf29c /discord/reaction.py
parentAdd support for on_invite_create and on_invite_delete (diff)
downloaddiscord.py-87f9dcff9c5af9c4fa6e6b148663320522a3c82f.tar.xz
discord.py-87f9dcff9c5af9c4fa6e6b148663320522a3c82f.zip
Add support for clearing a specific reaction.
Closes #2440
Diffstat (limited to 'discord/reaction.py')
-rw-r--r--discord/reaction.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/discord/reaction.py b/discord/reaction.py
index c7f2ef77..79c8efe2 100644
--- a/discord/reaction.py
+++ b/discord/reaction.py
@@ -121,6 +121,28 @@ class Reaction:
await self.message.remove_reaction(self.emoji, user)
+ async def clear(self):
+ """|coro|
+
+ Clears this reaction from the message.
+
+ You need the :attr:`~Permissions.manage_messages` permission to use this.
+
+ .. versionadded:: 1.3
+
+ Raises
+ --------
+ HTTPException
+ Clearing the reaction failed.
+ Forbidden
+ You do not have the proper permissions to clear the reaction.
+ NotFound
+ The emoji you specified was not found.
+ InvalidArgument
+ The emoji parameter is invalid.
+ """
+ await self.message.clear_reaction(self.emoji)
+
def users(self, limit=None, after=None):
"""Returns an :class:`AsyncIterator` representing the users that have reacted to the message.