File tree Expand file tree Collapse file tree
command/src/main/java/me/schlaubi/regnumutils/command/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,9 +73,9 @@ public static EmbedBuilder formatCommand(
7373 } else {
7474 embed .addField ("Type" , "Command" , true );
7575 }
76- embed .addField ("Usage" , usageBase + command .getUsage (), false );
77- if (! command . getExampleUsage (). isEmpty () && ! command .getExampleUsage (). isBlank ( )) {
78- embed .addField ("Example Usage" , usageBase + command .getExampleUsage (), false );
76+ embed .addField ("Usage" , usageBase + command .getUsage (). trim () , false );
77+ if (isPresent ( command .getExampleUsage ())) {
78+ embed .addField ("Example Usage" , usageBase + command .getExampleUsage (). trim () , false );
7979 }
8080
8181 if (command .hasSubCommands ()) {
@@ -100,6 +100,10 @@ public static EmbedBuilder formatCommand(
100100 return embed ;
101101 }
102102
103+ private static boolean isPresent (String usage ) {
104+ return !usage .isEmpty () && !usage .isBlank ();
105+ }
106+
103107 private static String formatUsageBase (CharSequence prefix , Command command ) {
104108 final var buf = new StringBuilder (prefix );
105109 var currentCommand = command ;
You can’t perform that action at this time.
0 commit comments