Archiviert
1
0

Fix EventManager

Dieser Commit ist enthalten in:
yoyosource 2021-07-28 17:38:46 +02:00
Ursprung d9607e86ce
Commit eda6a199fa

Datei anzeigen

@ -24,6 +24,7 @@ import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import de.steamwar.bungeecore.sql.Event; import de.steamwar.bungeecore.sql.Event;
import de.steamwar.bungeecore.sql.EventFight; import de.steamwar.bungeecore.sql.EventFight;
import de.steamwar.bungeecore.sql.Team; import de.steamwar.bungeecore.sql.Team;
import de.steamwar.bungeecore.sql.TeamTeilnahme;
import lombok.experimental.UtilityClass; import lombok.experimental.UtilityClass;
import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.MessageBuilder; import net.dv8tion.jda.api.MessageBuilder;
@ -34,6 +35,7 @@ import java.awt.*;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.time.Instant; import java.time.Instant;
import java.time.temporal.ChronoUnit; import java.time.temporal.ChronoUnit;
import java.util.stream.Collectors;
@UtilityClass @UtilityClass
public class EventManager { public class EventManager {
@ -70,6 +72,10 @@ public class EventManager {
st.append("Deadline: <t:").append(event.getDeadline().getTime() / 1000).append(":R>\n"); st.append("Deadline: <t:").append(event.getDeadline().getTime() / 1000).append(":R>\n");
} }
st.append("Start: <t:").append(event.getStart().getTime() / 1000).append(":R>"); st.append("Start: <t:").append(event.getStart().getTime() / 1000).append(":R>");
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); embedBuilder.addField(event.getEventName(), st.toString(), false);
}); });