Vaerys_Dawn

Help Handler

Jul 6th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. private String helpHandler(String type){
  2.     Method[] methods = this.getClass().getMethods();
  3.     StringBuilder builder = new StringBuilder();
  4.     builder.append("Here are all of the "+ WordUtils.capitalize(type) + "Commands:");
  5.     for (Method m : methods) {
  6.         if (m.isAnnotationPresent(CommandAnnotation.class)) {
  7.             CommandAnnotation anno = m.getAnnotation(CommandAnnotation.class);
  8.             if (anno.type().equalsIgnoreCase(type)) {
  9.                 builder.append("\n   " + Globals.commandPrefix + anno.name());
  10.             }
  11.         }
  12.     }
  13.     return builder.toString();
  14. }
Advertisement
Add Comment
Please, Sign In to add comment