Add TeamCommand Online type
Dieser Commit ist enthalten in:
Ursprung
ca52aa40df
Commit
9e4dbcdbb8
@ -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.OptionType;
|
||||
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class TeamCommand extends BasicDiscordCommand {
|
||||
@ -71,8 +73,11 @@ public class TeamCommand extends BasicDiscordCommand {
|
||||
EmbedBuilder embedBuilder = new EmbedBuilder();
|
||||
embedBuilder.setTitle("Team: " + team.getTeamName() + " [" + team.getTeamKuerzel() + "]");
|
||||
embedBuilder.setColor(Color.GRAY);
|
||||
embedBuilder.addField("Leader", "`" + team.getMembers().stream().map(SteamwarUser::get).filter(SteamwarUser::isLeader).map(SteamwarUser::getUserName).collect(Collectors.joining("` `")) + "`", false);
|
||||
embedBuilder.addField("Member", "`" + team.getMembers().stream().map(SteamwarUser::get).filter(user -> !user.isLeader()).map(SteamwarUser::getUserName).collect(Collectors.joining("` `")) + "`", false);
|
||||
List<SteamwarUser> members = team.getMembers().stream().map(SteamwarUser::get).collect(Collectors.toList());
|
||||
|
||||
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);
|
||||
event.replyEmbeds(embedBuilder.build()).setEphemeral(true).complete();
|
||||
return;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren