From d6933cb39bb5d979da363e4e5209c5ad41c29e56 Mon Sep 17 00:00:00 2001 From: Quanta Date: Sat, 10 Oct 2020 14:09:33 +0530 Subject: Use discord.Reaction#clear to remove reactions --- bot/exts/halloween/candy_collection.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/bot/exts/halloween/candy_collection.py b/bot/exts/halloween/candy_collection.py index 80a21991..8cd4b7ed 100644 --- a/bot/exts/halloween/candy_collection.py +++ b/bot/exts/halloween/candy_collection.py @@ -107,7 +107,7 @@ class CandyCollection(commands.Cog): else: return # Skip saving - await CandyCollection.remove_reactions(reaction) + await reaction.clear() await self.bot.loop.run_in_executor(None, self.save_to_json) async def reacted_msg_chance(self, message: discord.Message) -> None: @@ -147,16 +147,6 @@ class CandyCollection(commands.Cog): """Get #hacktoberbot channel from its ID.""" return self.bot.get_channel(id=Channels.seasonalbot_commands) - @classmethod - async def remove_reactions(cls, reaction: discord.Reaction) -> None: - """Remove all candy/skull reactions.""" - try: - async for user in reaction.users(): - await reaction.message.remove_reaction(reaction.emoji, user) - - except discord.HTTPException: - pass - @classmethod async def send_spook_msg(cls, author: discord.Member, channel: discord.TextChannel, candies: Union[str, int]) -> None: -- cgit v1.2.3