diff --git a/api/src/main/java/com/alttd/chat/config/Config.java b/api/src/main/java/com/alttd/chat/config/Config.java index 5140cd9..d3f5fcf 100755 --- a/api/src/main/java/com/alttd/chat/config/Config.java +++ b/api/src/main/java/com/alttd/chat/config/Config.java @@ -422,6 +422,7 @@ public final class Config { public static HashMap serverChannelId = new HashMap<>(); public static String REPORT_SENT = "Your report was sent, staff will contact you asap to help resolve your issue!"; + public static String REPORT_TOO_SHORT = "Please ensure your report is descriptive. We require at least 3 words per report"; private static void loadChannelIds() { serverChannelId.clear(); serverChannelId.put("general", getLong("discord-channel-id.general", (long) -1)); @@ -436,6 +437,7 @@ public final class Config { serverChannelId.put(key.toLowerCase(), channelId); } REPORT_SENT = getString("messages.report-sent", REPORT_SENT); + REPORT_TOO_SHORT = getString("messages.report-too-short", REPORT_TOO_SHORT); } public static String HELP_REPORT = "/report "; diff --git a/velocity/src/main/java/com/alttd/velocitychat/commands/Report.java b/velocity/src/main/java/com/alttd/velocitychat/commands/Report.java index 1ca543b..89b076e 100644 --- a/velocity/src/main/java/com/alttd/velocitychat/commands/Report.java +++ b/velocity/src/main/java/com/alttd/velocitychat/commands/Report.java @@ -45,6 +45,11 @@ public class Report { if (optionalServerConnection.isEmpty()) { return 1; } + String report = context.getArgument("report", String.class); + if (report.split(" ").length < 3) { + player.sendMessage(Utility.parseMiniMessage(Config.REPORT_TOO_SHORT)); + return 1; + } ServerConnection serverConnection = optionalServerConnection.get(); String serverName = serverConnection.getServer().getServerInfo().getName(); @@ -53,7 +58,7 @@ public class Report { embedBuilder.setTitle("Player Report"); embedBuilder.setColor(Color.CYAN); embedBuilder.addField("Incident", - context.getArgument("report", String.class), + report, false); embedBuilder.addField("Server", serverName.substring(0, 1).toUpperCase() + serverName.substring(1),