From fa90f7c4afcb5126b0f0a9f8fa65c8ff22242701 Mon Sep 17 00:00:00 2001 From: flifloo Date: Fri, 10 Apr 2020 20:41:58 +0200 Subject: [PATCH] Faster clean reaction to avoid count loss --- extensions/poll.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/poll.py b/extensions/poll.py index abfb792..0777487 100644 --- a/extensions/poll.py +++ b/extensions/poll.py @@ -72,10 +72,11 @@ class Poll(commands.Cog): async def close_poll(self, id: int): message = await self.polls[id]["message"].channel.fetch_message(id) + reactions = message.reactions + await message.clear_reactions() embed = message.embeds[0] for i, f in enumerate(embed.fields): - embed.set_field_at(i, name=f"{f.name} - {message.reactions[i].count-1}", value=f.value, inline=False) - await message.clear_reactions() + embed.set_field_at(i, name=f"{f.name} - {reactions[i].count-1}", value=f.value, inline=False) await message.edit(embed=embed) @commands.Cog.listener()