Faster clean reaction to avoid count loss
This commit is contained in:
parent
b1f37c2ecf
commit
fa90f7c4af
1 changed files with 3 additions and 2 deletions
|
@ -72,10 +72,11 @@ class Poll(commands.Cog):
|
||||||
|
|
||||||
async def close_poll(self, id: int):
|
async def close_poll(self, id: int):
|
||||||
message = await self.polls[id]["message"].channel.fetch_message(id)
|
message = await self.polls[id]["message"].channel.fetch_message(id)
|
||||||
|
reactions = message.reactions
|
||||||
|
await message.clear_reactions()
|
||||||
embed = message.embeds[0]
|
embed = message.embeds[0]
|
||||||
for i, f in enumerate(embed.fields):
|
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)
|
embed.set_field_at(i, name=f"{f.name} - {reactions[i].count-1}", value=f.value, inline=False)
|
||||||
await message.clear_reactions()
|
|
||||||
await message.edit(embed=embed)
|
await message.edit(embed=embed)
|
||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
|
|
Reference in a new issue