]> git.aero2k.de Git - urlbot-v3.git/commitdiff
poll: fix get_votes
authorThorsten <mail@aero2k.de>
Sun, 8 Sep 2024 11:06:27 +0000 (13:06 +0200)
committerThorsten <mail@aero2k.de>
Sun, 8 Sep 2024 11:06:27 +0000 (13:06 +0200)
src/distbot/plugins/votepoll.py

index 0f421c4cfbf9329bea9ccfc84fa8b9d678373782..0111cf332e13dbe349c6631592bc8f38597dcd9b 100644 (file)
@@ -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: