From: Thorsten Date: Mon, 9 Sep 2024 20:36:18 +0000 (+0200) Subject: re-add vote duration limit X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=699e3723af05d81a978723763a3a4a892ed4541c;p=urlbot-v3.git re-add vote duration limit --- diff --git a/src/distbot/plugins/votepoll.py b/src/distbot/plugins/votepoll.py index 9768df3..9c63bc3 100644 --- a/src/distbot/plugins/votepoll.py +++ b/src/distbot/plugins/votepoll.py @@ -169,6 +169,7 @@ class VotePoll(Worker): # duplicate options return Action(msg="No duplicate options.") vote_duration = self.vote_duration if not vote_duration else vote_duration + vote_duration = min(self.max_vote_duration, max(30, vote_duration)) # setup new poll poll = Poll(options, {}, now + vote_duration) # check prior results @@ -185,7 +186,6 @@ class VotePoll(Worker): # setup timeout to disable poll and present results bot_nick = conf_get("bot_nickname") - poll_message = (f"**New Vote:** {sender} started a vote! " f"Vote within {vote_duration}s " f"(reply with '{bot_nick}: vote A/B/foo' within {vote_duration}s)"