Require reports to be at least 3 words long
This commit is contained in:
parent
1946cd4ab7
commit
faa0435131
|
|
@ -422,6 +422,7 @@ public final class Config {
|
||||||
|
|
||||||
public static HashMap<String, Long> serverChannelId = new HashMap<>();
|
public static HashMap<String, Long> serverChannelId = new HashMap<>();
|
||||||
public static String REPORT_SENT = "<green>Your report was sent, staff will contact you asap to help resolve your issue!</green>";
|
public static String REPORT_SENT = "<green>Your report was sent, staff will contact you asap to help resolve your issue!</green>";
|
||||||
|
public static String REPORT_TOO_SHORT = "<red>Please ensure your report is descriptive. We require at least 3 words per report</red>";
|
||||||
private static void loadChannelIds() {
|
private static void loadChannelIds() {
|
||||||
serverChannelId.clear();
|
serverChannelId.clear();
|
||||||
serverChannelId.put("general", getLong("discord-channel-id.general", (long) -1));
|
serverChannelId.put("general", getLong("discord-channel-id.general", (long) -1));
|
||||||
|
|
@ -436,6 +437,7 @@ public final class Config {
|
||||||
serverChannelId.put(key.toLowerCase(), channelId);
|
serverChannelId.put(key.toLowerCase(), channelId);
|
||||||
}
|
}
|
||||||
REPORT_SENT = getString("messages.report-sent", REPORT_SENT);
|
REPORT_SENT = getString("messages.report-sent", REPORT_SENT);
|
||||||
|
REPORT_TOO_SHORT = getString("messages.report-too-short", REPORT_TOO_SHORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String HELP_REPORT = "<red>/report <message></red>";
|
public static String HELP_REPORT = "<red>/report <message></red>";
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,11 @@ public class Report {
|
||||||
if (optionalServerConnection.isEmpty()) {
|
if (optionalServerConnection.isEmpty()) {
|
||||||
return 1;
|
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();
|
ServerConnection serverConnection = optionalServerConnection.get();
|
||||||
String serverName = serverConnection.getServer().getServerInfo().getName();
|
String serverName = serverConnection.getServer().getServerInfo().getName();
|
||||||
|
|
||||||
|
|
@ -53,7 +58,7 @@ public class Report {
|
||||||
embedBuilder.setTitle("Player Report");
|
embedBuilder.setTitle("Player Report");
|
||||||
embedBuilder.setColor(Color.CYAN);
|
embedBuilder.setColor(Color.CYAN);
|
||||||
embedBuilder.addField("Incident",
|
embedBuilder.addField("Incident",
|
||||||
context.getArgument("report", String.class),
|
report,
|
||||||
false);
|
false);
|
||||||
embedBuilder.addField("Server",
|
embedBuilder.addField("Server",
|
||||||
serverName.substring(0, 1).toUpperCase() + serverName.substring(1),
|
serverName.substring(0, 1).toUpperCase() + serverName.substring(1),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user