]> git.aero2k.de Git - urlbot-v3.git/commitdiff
increase default/max voting durations, since we can end it early
authorThorsten <mail@aero2k.de>
Tue, 10 Sep 2024 16:15:44 +0000 (18:15 +0200)
committerThorsten <mail@aero2k.de>
Tue, 10 Sep 2024 16:15:44 +0000 (18:15 +0200)
src/distbot/plugins/votepoll.py

index 9c63bc367b1ecead861d9aec23073cd9efd44131..2ce8dbfe184867966f63142b8a8f6eedf6cc8b23 100644 (file)
@@ -132,8 +132,8 @@ class VotePoll(Worker):
         "Create a new poll using poll 'ice cream' vs cake, optionally followed by voting time in seconds (max 1h), "
         "then respond with vote a/b or vote cake to place a vote. Use pollstatus for a report on current votes.")
 
-    vote_duration = 60 * 1
-    max_vote_duration = 60 * 60 * 12
+    vote_duration = 60 * 15  # 15min
+    max_vote_duration = 60 * 60 * 24 * 14  # two weeks
 
     KEY_ACTIVE = "active".encode()
 
@@ -178,8 +178,8 @@ class VotePoll(Worker):
             else:
                 prior_poll = self.get_poll(poll.key)
                 if prior_poll and prior_poll.votes:
-
-                    return Action(msg=f"This was already decided at {prior_poll.end_date}: {prior_poll.status_report()}")
+                    return Action(
+                        msg=f"This was already decided at {prior_poll.end_date}: {prior_poll.status_report()}")
 
             # enable poll
             self.start_poll(poll)
@@ -214,7 +214,7 @@ class VotePoll(Worker):
             if i % 2 == 1 or i == len(words) - 1:
                 if word == "vs":
                     options.append(words[i - 1])
-                elif i == len(words) - 1 and words[i-1] == "vs":
+                elif i == len(words) - 1 and words[i - 1] == "vs":
                     options.append(word)
                 elif i == len(words) - 1 and word.isnumeric():
                     options.append(words[i - 1])