Skip to content

Commit d888d21

Browse files
committed
Don't count irrelevant reactions in vote counting
1 parent 4372e03 commit d888d21

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/vote.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ async def set_off_ballot(
124124
else:
125125
emojis = self._list_answers(letters=letters, numeric_scale_max=numeric_scale_max)
126126
reactions_with_users = await asyncio.gather(
127-
*(self._resolve_reaction_with_user_count(reaction) for reaction in urn_message.reactions)
127+
*(
128+
self._resolve_reaction_with_user_count(reaction)
129+
for reaction in urn_message.reactions
130+
if reaction.emoji in emojis
131+
)
128132
)
129133
results = dict(reactions_with_users)
130134
winning_emojis = []

0 commit comments

Comments
 (0)