diff --git a/src/main/java/app/services/db/ReportService.java b/src/main/java/app/services/db/ReportService.java index 41b3e52..0b7f09b 100644 --- a/src/main/java/app/services/db/ReportService.java +++ b/src/main/java/app/services/db/ReportService.java @@ -73,8 +73,8 @@ public class ReportService { reported_player==null?null:reported_player.getDeads(), reported_player==null?null:reported_player.getDuration_seconds(), - text, Instant.now().getEpochSecond(), reported_user.getPlay_on().getServer_id(), - stats.getServers().get(reported_user.getPlay_on().getServer_id()).getPlayer_count(), + text, Instant.now().getEpochSecond(), reported_user==null?current_user.getPlay_on().getServer_id():reported_user.getPlay_on().getServer_id(), + stats.getServers().get(reported_user==null?current_user.getPlay_on().getServer_id():reported_user.getPlay_on().getServer_id()).getPlayer_count(), reportType.ordinal()); } @@ -152,17 +152,17 @@ public class ReportService { HashMap embed = new HashMap<>(); embed.put("author", Map.of("name", author, "url", current_user.getSteamids().community_url)); - if (reported_user != null) + if (reported_user != null) { embed.put("title", reported); - - embed.put("url", reported_user.getSteamids().community_url); + embed.put("url", reported_user.getSteamids().community_url); + } embed.put("description", text); embed.put("color", 16581375); // 255 * 255 * 255 | black embed.put("footer", Map.of( "text", "%s • %d/%d ".formatted( - stats.getServers().get(reported_user.getPlay_on().getServer_id()).getName(), - stats.getServers().get(reported_user.getPlay_on().getServer_id()).getPlayer_count(), - stats.getServers().get(reported_user.getPlay_on().getServer_id()).getMax_players()), + stats.getServers().get(reported_user==null?current_user.getPlay_on().getServer_id():reported_user.getPlay_on().getServer_id()).getName(), + stats.getServers().get(reported_user==null?current_user.getPlay_on().getServer_id():reported_user.getPlay_on().getServer_id()).getPlayer_count(), + stats.getServers().get(reported_user==null?current_user.getPlay_on().getServer_id():reported_user.getPlay_on().getServer_id()).getMax_players()), "icon_url", tf2_icon )); embed.put("timestamp", Instant.now().toString());