From: Thorsten Date: Tue, 10 Sep 2024 16:15:44 +0000 (+0200) Subject: increase default/max voting durations, since we can end it early X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=05a950dd0369ddef18ffec2696a2a81d5f36bbf1;p=urlbot-v3.git increase default/max voting durations, since we can end it early --- diff --git a/src/distbot/plugins/votepoll.py b/src/distbot/plugins/votepoll.py index 9c63bc3..2ce8dbf 100644 --- a/src/distbot/plugins/votepoll.py +++ b/src/distbot/plugins/votepoll.py @@ -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])