From 699e3723af05d81a978723763a3a4a892ed4541c Mon Sep 17 00:00:00 2001 From: Thorsten Date: Mon, 9 Sep 2024 22:36:18 +0200 Subject: [PATCH] re-add vote duration limit --- src/distbot/plugins/votepoll.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)" -- 2.39.2