[AB-63] adding pressF command

fixing not setting the won flag for giveaway participants
This commit is contained in:
Sheldan
2023-12-11 01:26:07 +01:00
parent 4b3038078e
commit 52c805f4ea
32 changed files with 890 additions and 7 deletions

View File

@@ -148,6 +148,7 @@ public class GiveawayServiceBean implements GiveawayService {
Giveaway giveaway = giveAwayOptional.get();
Set<Long> winners = new HashSet<>();
Integer winnerCount = giveaway.getWinnerCount();
giveaway.getParticipants().forEach(giveawayParticipant -> giveawayParticipant.setWon(false));
List<Long> potentialWinners = new ArrayList<>(giveaway
.getParticipants()
.stream()
@@ -170,6 +171,7 @@ public class GiveawayServiceBean implements GiveawayService {
.stream()
.filter(giveawayParticipant -> winners.contains(giveawayParticipant.getParticipant().getUserInServerId()))
.toList();
winningParticipants.forEach(giveawayParticipant -> giveawayParticipant.setWon(true));
List<MemberDisplay> winnerDisplays = winningParticipants
.stream()
.map(giveawayParticipant -> MemberDisplay.fromAUserInAServer(giveawayParticipant.getParticipant()))