From 2b842ad0810e455587f93b6015d7fe19e33d635a Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Wed, 13 May 2026 22:01:14 -0700 Subject: [PATCH 1/3] Fixes vote remind to round start time --- techsupport_bot/commands/voting.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/techsupport_bot/commands/voting.py b/techsupport_bot/commands/voting.py index e9130df9..1cff35d0 100644 --- a/techsupport_bot/commands/voting.py +++ b/techsupport_bot/commands/voting.py @@ -665,6 +665,11 @@ async def execute(self: Self, config: munch.Munch, guild: discord.Guild) -> None for vote in active_votes: end_time = int((vote.start_time + timedelta(hours=72)).timestamp()) + # Round up to next hour to match the hourly check + rounded_start_time = vote.start_time.replace( + minute=0, second=0, microsecond=0 + ) + timedelta(hours=1) + # End expired votes if end_time <= timestamp_now: await self.end_vote(vote, guild, config) @@ -672,9 +677,12 @@ async def execute(self: Self, config: munch.Munch, guild: discord.Guild) -> None # Reminder checks for reminder_hour in reminder_times: - reminder_timestamp = end_time - (reminder_hour * 3600) + reminder_timestamp = int( + ( + rounded_start_time + timedelta(hours=(72 - reminder_hour)) + ).timestamp() + ) - # To allow for some slight variation in time, give a 5 minute valid reminder window if abs(timestamp_now - reminder_timestamp) <= 300: await self.remind_vote(vote, guild, config, reminder_hour) From abc1e9f0220f30f9c788fd90ce023d2673266456 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Wed, 13 May 2026 22:01:48 -0700 Subject: [PATCH 2/3] Add check for no non-voters --- techsupport_bot/commands/voting.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/techsupport_bot/commands/voting.py b/techsupport_bot/commands/voting.py index 1cff35d0..7d20949e 100644 --- a/techsupport_bot/commands/voting.py +++ b/techsupport_bot/commands/voting.py @@ -708,6 +708,8 @@ async def remind_vote( voted_voters = [v for v in vote.vote_ids_all.split(",") if v] non_voters = [v for v in eligible_voters if v not in voted_voters] + if len(non_voters) == 0: + return # Theoretically we can exceed the max length of a discord message. Cut at 60 just in case. # We would probably error somewhere else if 61 people ever could vote though From 8961e93f84f713ae167327da1a6c853b2daa9487 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Wed, 13 May 2026 22:03:09 -0700 Subject: [PATCH 3/3] Formatting --- techsupport_bot/commands/voting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/techsupport_bot/commands/voting.py b/techsupport_bot/commands/voting.py index 7d20949e..774387bc 100644 --- a/techsupport_bot/commands/voting.py +++ b/techsupport_bot/commands/voting.py @@ -679,7 +679,7 @@ async def execute(self: Self, config: munch.Munch, guild: discord.Guild) -> None for reminder_hour in reminder_times: reminder_timestamp = int( ( - rounded_start_time + timedelta(hours=(72 - reminder_hour)) + rounded_start_time + timedelta(hours=72 - reminder_hour) ).timestamp() )