From eda6a199fa4ba22677c1f20060610ce2eaf80fcf Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 28 Jul 2021 17:38:46 +0200 Subject: [PATCH] Fix EventManager --- src/de/steamwar/bungeecore/bot/events/EventManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/de/steamwar/bungeecore/bot/events/EventManager.java b/src/de/steamwar/bungeecore/bot/events/EventManager.java index 4e88e17..53daa79 100644 --- a/src/de/steamwar/bungeecore/bot/events/EventManager.java +++ b/src/de/steamwar/bungeecore/bot/events/EventManager.java @@ -24,6 +24,7 @@ import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig; import de.steamwar.bungeecore.sql.Event; import de.steamwar.bungeecore.sql.EventFight; import de.steamwar.bungeecore.sql.Team; +import de.steamwar.bungeecore.sql.TeamTeilnahme; import lombok.experimental.UtilityClass; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.MessageBuilder; @@ -34,6 +35,7 @@ import java.awt.*; import java.sql.Timestamp; import java.time.Instant; import java.time.temporal.ChronoUnit; +import java.util.stream.Collectors; @UtilityClass public class EventManager { @@ -70,6 +72,10 @@ public class EventManager { st.append("Deadline: \n"); } st.append("Start: "); + String teilname = TeamTeilnahme.getTeams(event.getEventID()).stream().map(Team::getTeamKuerzel).collect(Collectors.joining(", ")); + if (!teilname.isEmpty()) { + st.append("\nAngemeldete Teams: ").append(teilname); + } embedBuilder.addField(event.getEventName(), st.toString(), false); });