From 4583dc3c48b73a00fc6680b75e3fcadc2eb58f0e Mon Sep 17 00:00:00 2001 From: RyGuy Date: Wed, 29 Mar 2023 16:06:53 -0400 Subject: [PATCH] Ensure you're updating end instant, fixes #227, partially helps #228 --- src/main/java/com/jagrosh/giveawaybot/GiveawayManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/jagrosh/giveawaybot/GiveawayManager.java b/src/main/java/com/jagrosh/giveawaybot/GiveawayManager.java index 0aad9b1c..1e9fd014 100644 --- a/src/main/java/com/jagrosh/giveawaybot/GiveawayManager.java +++ b/src/main/java/com/jagrosh/giveawaybot/GiveawayManager.java @@ -36,6 +36,7 @@ import com.jagrosh.interactions.requests.Route; import com.jagrosh.interactions.util.JsonUtil; import java.awt.Color; +import java.time.Clock; import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -137,6 +138,7 @@ public boolean endGiveaway(Giveaway giveaway) List all = new ArrayList<>(entries); List winners = GiveawayUtil.selectWinners(all, giveaway.getWinners()); CachedUser host = database.getUser(giveaway.getUserId()); + giveaway.setEndInstant(Instant.now(Clock.systemDefaultZone())); try { JSONObject summary = createGiveawaySummary(giveaway, host, entries, winners);