From: Thorsten Date: Sun, 8 Sep 2024 11:06:27 +0000 (+0200) Subject: poll: fix get_votes X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=ff00b624ecd6870ac4e942bb6b644a2974ba415e;p=urlbot-v3.git poll: fix get_votes --- diff --git a/src/distbot/plugins/votepoll.py b/src/distbot/plugins/votepoll.py index 0f421c4..0111cf3 100644 --- a/src/distbot/plugins/votepoll.py +++ b/src/distbot/plugins/votepoll.py @@ -50,7 +50,7 @@ class Poll: def get_votes(self, option: str) -> int: option = self.option(option) if option: - return len(self.votes.get(option, [])) + return len([vote for vote in self.votes.values() if vote == option]) @staticmethod def generate_key(options: list[str]) -> str: