Archiviert
1
0

Add TeamCommand Online type

Dieser Commit ist enthalten in:
yoyosource 2021-07-30 13:50:47 +02:00
Ursprung ca52aa40df
Commit 9e4dbcdbb8

Datei anzeigen

@ -28,8 +28,10 @@ import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
import net.dv8tion.jda.api.interactions.commands.OptionMapping; import net.dv8tion.jda.api.interactions.commands.OptionMapping;
import net.dv8tion.jda.api.interactions.commands.OptionType; import net.dv8tion.jda.api.interactions.commands.OptionType;
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData; import net.dv8tion.jda.api.interactions.commands.build.SubcommandData;
import net.md_5.bungee.api.ProxyServer;
import java.awt.*; import java.awt.*;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class TeamCommand extends BasicDiscordCommand { public class TeamCommand extends BasicDiscordCommand {
@ -71,8 +73,11 @@ public class TeamCommand extends BasicDiscordCommand {
EmbedBuilder embedBuilder = new EmbedBuilder(); EmbedBuilder embedBuilder = new EmbedBuilder();
embedBuilder.setTitle("Team: " + team.getTeamName() + " [" + team.getTeamKuerzel() + "]"); embedBuilder.setTitle("Team: " + team.getTeamName() + " [" + team.getTeamKuerzel() + "]");
embedBuilder.setColor(Color.GRAY); embedBuilder.setColor(Color.GRAY);
embedBuilder.addField("Leader", "`" + team.getMembers().stream().map(SteamwarUser::get).filter(SteamwarUser::isLeader).map(SteamwarUser::getUserName).collect(Collectors.joining("` `")) + "`", false); List<SteamwarUser> members = team.getMembers().stream().map(SteamwarUser::get).collect(Collectors.toList());
embedBuilder.addField("Member", "`" + team.getMembers().stream().map(SteamwarUser::get).filter(user -> !user.isLeader()).map(SteamwarUser::getUserName).collect(Collectors.joining("` `")) + "`", false);
embedBuilder.addField("Leader", "`" + members.stream().filter(SteamwarUser::isLeader).map(SteamwarUser::getUserName).collect(Collectors.joining("` `")) + "`", false);
embedBuilder.addField("Member", "`" + members.stream().filter(user -> !user.isLeader()).map(SteamwarUser::getUserName).collect(Collectors.joining("` `")) + "`", false);
embedBuilder.addField("Online", "`" + members.stream().filter(user -> ProxyServer.getInstance().getPlayer(user.getUuid()) != null).map(SteamwarUser::getUserName).collect(Collectors.joining("` `")) + "`", false);
embedBuilder.addField("Events", "`" + TeamTeilnahme.getEvents(team.getTeamId()).stream().map(Event::getEventName).collect(Collectors.joining("` `")) + "`", false); embedBuilder.addField("Events", "`" + TeamTeilnahme.getEvents(team.getTeamId()).stream().map(Event::getEventName).collect(Collectors.joining("` `")) + "`", false);
event.replyEmbeds(embedBuilder.build()).setEphemeral(true).complete(); event.replyEmbeds(embedBuilder.build()).setEphemeral(true).complete();
return; return;