Skip to content

Commit

Permalink
Ensure you're updating end instant, fixes jagrosh#227, partially helps
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealRyGuy committed Mar 30, 2023
1 parent e4d1a8a commit 4583dc3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/jagrosh/giveawaybot/GiveawayManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -137,6 +138,7 @@ public boolean endGiveaway(Giveaway giveaway)
List<CachedUser> all = new ArrayList<>(entries);
List<CachedUser> 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);
Expand Down

0 comments on commit 4583dc3

Please sign in to comment.