diff options
author | 2020-10-10 14:09:33 +0530 | |
---|---|---|
committer | 2020-10-10 14:09:33 +0530 | |
commit | d6933cb39bb5d979da363e4e5209c5ad41c29e56 (patch) | |
tree | 9911ca545113dc8b6f47677005eb33a2c3aa395a /bot/exts | |
parent | Better organize and format candy command (diff) |
Use discord.Reaction#clear to remove reactions
Diffstat (limited to 'bot/exts')
-rw-r--r-- | bot/exts/halloween/candy_collection.py | 12 |
1 files changed, 1 insertions, 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: @@ -148,16 +148,6 @@ class CandyCollection(commands.Cog): 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: """Send a spooky message.""" |