|
|
|
@ -57,9 +57,14 @@ class InternalCommandsModule extends AbstractModule
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
toReturn.append("\nUsage: ").append(Configuration.getValue("general", "commandPrefix")).append(command);
|
|
|
|
|
for(Class<?> i : matchingMethod.getMethod().getParameterTypes())
|
|
|
|
|
if(i != MessageReceivedEvent.class)
|
|
|
|
|
toReturn.append(" <").append(i.getName()).append(">");
|
|
|
|
|
|
|
|
|
|
for(int i=1; i < matchingMethod.getMethod().getParameterCount(); i++)
|
|
|
|
|
{
|
|
|
|
|
// Try to know if the field is required (or not) from the Command annotation
|
|
|
|
|
String brackets = "<>";
|
|
|
|
|
try { if(!matchingMethod.getMethod().getAnnotation(Command.class).required()[i-1]) brackets = "[]"; } catch (ArrayIndexOutOfBoundsException e) {}
|
|
|
|
|
toReturn.append(" ").append(brackets.charAt(0)).append(matchingMethod.getMethod().getParameterTypes()[i].getSimpleName()).append(brackets.charAt(1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return toReturn.toString();
|
|
|
|
|
}
|
|
|
|
|