SteamWar/BungeeCore
Archiviert
13
2

Hotfix TeamCommand

Dieser Commit ist enthalten in:
yoyosource 2021-07-30 13:14:38 +02:00
Ursprung ebfe912627
Commit 66c9d206e7

Datei anzeigen

@ -45,9 +45,6 @@ public class TeamCommand extends BasicDiscordCommand {
@Override @Override
public void run(SlashCommandEvent event) { public void run(SlashCommandEvent event) {
SteamwarUser steamwarUser = getSteamwarUser(event); SteamwarUser steamwarUser = getSteamwarUser(event);
if (steamwarUser == null) {
return;
}
if (event.getSubcommandName() != null) { if (event.getSubcommandName() != null) {
switch (event.getSubcommandName()) { switch (event.getSubcommandName()) {
@ -55,12 +52,15 @@ public class TeamCommand extends BasicDiscordCommand {
OptionMapping optionMapping = event.getOption("team"); OptionMapping optionMapping = event.getOption("team");
Team team; Team team;
if (optionMapping == null) { if (optionMapping == null) {
if (steamwarUser == null) {
event.reply("Dein Discord ist nicht verknüpft").setEphemeral(true).complete();
return;
}
if (steamwarUser.getTeam() == 0) { if (steamwarUser.getTeam() == 0) {
event.reply("Du bist in keinem Team").setEphemeral(true).complete(); event.reply("Du bist in keinem Team").setEphemeral(true).complete();
return; return;
} else {
team = Team.get(steamwarUser.getTeam());
} }
team = Team.get(steamwarUser.getTeam());
} else { } else {
team = Team.get(optionMapping.getAsString()); team = Team.get(optionMapping.getAsString());
} }