src/main/java/me/evyn/bot/commands/info/Usage.java
@Override
    public void run(MessageReceivedEvent event, String prefix, boolean embed, String[] args) {

        User bot = event.getJDA().getSelfUser();

        // if no arguments are present, send error and return
        if (args.length == 0) {
            String desc = "Invalid command usage. Try running `" + prefix + "usage [command]`";
            if (embed) {
                EmbedBuilder eb = EmbedCreator.newErrorEmbedMessage(bot, desc);
                event.getChannel()
                        .sendMessage(eb.build())
                        .queue();
                return;
            } else {
                event.getChannel()
                        .sendMessage("ERROR: " + desc)
                        .queue();
            }
        } else {
            // attempt to find command
            String cmd = args[0];

            Command command = CommandHandler.findCommand(cmd);

            // if command cannot be found, send error and return
            if (command == null) {
                String desc = "That command could not be found.";
                if (embed) {
                    EmbedBuilder eb = EmbedCreator.newErrorEmbedMessage(bot, desc);
                    event.getChannel()
                            .sendMessage(eb.build())
                            .queue();
                } else {
                    event.getChannel()
                            .sendMessage("ERROR: " + desc)
                            .queue();
                }

            } else {
                // found command, generate embed
                StringBuilder sb = new StringBuilder();

                // set command aliases
                if (command.getAliases().size() == 0) {
                    sb.append("None");
                } else {
                    for (String alias : command.getAliases()) {
                        sb.append(alias).append(", ");
                    }
                    sb.delete(sb.length() - 2, sb.length());
                }

                if (embed) {
                    EmbedBuilder eb = EmbedCreator.newCommandEmbedMessage(bot)
                            .setTitle("Usage: " + command.getName())
                            .setDescription("() Optional Argument" + "\n" + "[] Required Argument")
                            .addField("Description", command.getDescription(), false)
                            .addField("Command Usage", prefix + command.getUsage(), false)
                            .addField("Aliases", sb.toString(), false);

                    event.getChannel()
                            .sendMessage(eb.build())
                            .queue();
                } else {
                    event.getChannel()
                            .sendMessage("**Usage: " + command.getName() + "**\n" + "() Optional Argument" +
                                    "\n" + "[] Required Argument" + "\n\n" + "**Description:** " +
                                    command.getDescription() + "\n" + "**Command Usage:** " + prefix +
                                    command.getUsage() + "\n" + "**Aliases:** " + sb.toString())
                            .queue();
                }
            }
        }
    }
/**
     * Provides information on command usage and aliases
     * @param event Discord API message event
     * @param prefix Specific guild bot prefix
     * @param embed Guild embed setting
     * @param args Command arguments
     */
Provides information on command usage and aliases
@param event Discord API message event
@param prefix Specific guild bot prefix
@param embed Guild embed setting
@param args Command arguments
Provides information on command usage and aliases @param event Discord API message event @param prefix Specific guild bot prefix @param embed Guild embed setting @param args Command arguments
@Override
    public void run(MessageReceivedEvent event, String prefix, boolean embed, String[] args) {
        User bot = event.getJDA().getSelfUser();
        if (args.length == 0) {
            String desc = "Invalid command usage. Try running `" + prefix + "usage [command]`";
            if (embed) {
                EmbedBuilder eb = EmbedCreator.newErrorEmbedMessage(bot, desc);
                event.getChannel()
                        .sendMessage(eb.build())
                        .queue();
                return;
            } else {
                event.getChannel()
                        .sendMessage("ERROR: " + desc)
                        .queue();
            }
        } else {
            String cmd = args[0];
            Command command = CommandHandler.findCommand(cmd);
            if (command == null) {
                String desc = "That command could not be found.";
                if (embed) {
                    EmbedBuilder eb = EmbedCreator.newErrorEmbedMessage(bot, desc);
                    event.getChannel()
                            .sendMessage(eb.build())
                            .queue();
                } else {
                    event.getChannel()
                            .sendMessage("ERROR: " + desc)
                            .queue();
                }
            } else {
                StringBuilder sb = new StringBuilder();
                if (command.getAliases().size() == 0) {
                    sb.append("None");
                } else {
                    for (String alias : command.getAliases()) {
                        sb.append(alias).append(", ");
                    }
                    sb.delete(sb.length() - 2, sb.length());
                }
                if (embed) {
                    EmbedBuilder eb = EmbedCreator.newCommandEmbedMessage(bot)
                            .setTitle("Usage: " + command.getName())
                            .setDescription("() Optional Argument" + "\n" + "[] Required Argument")
                            .addField("Description", command.getDescription(), false)
                            .addField("Command Usage", prefix + command.getUsage(), false)
                            .addField("Aliases", sb.toString(), false);
                    event.getChannel()
                            .sendMessage(eb.build())
                            .queue();
                } else {
                    event.getChannel()
                            .sendMessage("**Usage: " + command.getName() + "**\n" + "() Optional Argument" +
                                    "\n" + "[] Required Argument" + "\n\n" + "**Description:** " +
                                    command.getDescription() + "\n" + "**Command Usage:** " + prefix +
                                    command.getUsage() + "\n" + "**Aliases:** " + sb.toString())
                            .queue();
                }
            }
        }
    }
@ Override public void run ( MessageReceivedEvent event , String prefix , boolean embed , String [ ] args ) { User bot = event . getJDA ( ) . getSelfUser ( ) ; if ( args . length == 0 ) { String desc = "Invalid command usage. Try running `" + prefix + "usage [command]`" ; if ( embed ) { EmbedBuilder eb = EmbedCreator . newErrorEmbedMessage ( bot , desc ) ; event . getChannel ( ) . sendMessage ( eb . build ( ) ) . queue ( ) ; return ; } else { event . getChannel ( ) . sendMessage ( "ERROR: " + desc ) . queue ( ) ; } } else { String cmd = args [ 0 ] ; Command command = CommandHandler . findCommand ( cmd ) ; if ( command == null ) { String desc = "That command could not be found." ; if ( embed ) { EmbedBuilder eb = EmbedCreator . newErrorEmbedMessage ( bot , desc ) ; event . getChannel ( ) . sendMessage ( eb . build ( ) ) . queue ( ) ; } else { event . getChannel ( ) . sendMessage ( "ERROR: " + desc ) . queue ( ) ; } } else { StringBuilder sb = new StringBuilder ( ) ; if ( command . getAliases ( ) . size ( ) == 0 ) { sb . append ( "None" ) ; } else { for ( String alias : command . getAliases ( ) ) { sb . append ( alias ) . append ( ", " ) ; } sb . delete ( sb . length ( ) - 2 , sb . length ( ) ) ; } if ( embed ) { EmbedBuilder eb = EmbedCreator . newCommandEmbedMessage ( bot ) . setTitle ( "Usage: " + command . getName ( ) ) . setDescription ( "() Optional Argument" + "\n" + "[] Required Argument" ) . addField ( "Description" , command . getDescription ( ) , false ) . addField ( "Command Usage" , prefix + command . getUsage ( ) , false ) . addField ( "Aliases" , sb . toString ( ) , false ) ; event . getChannel ( ) . sendMessage ( eb . build ( ) ) . queue ( ) ; } else { event . getChannel ( ) . sendMessage ( "**Usage: " + command . getName ( ) + "**\n" + "() Optional Argument" + "\n" + "[] Required Argument" + "\n\n" + "**Description:** " + command . getDescription ( ) + "\n" + "**Command Usage:** " + prefix + command . getUsage ( ) + "\n" + "**Aliases:** " + sb . toString ( ) ) . queue ( ) ; } } } }
Provides information on command usage and aliases
 @param event Discord API message event
 @param prefix Specific guild bot prefix
 @param embed Guild embed setting
 @param args Command arguments
Provides information on command usage and aliases @param event Discord API message event @param prefix Specific guild bot prefix @param embed Guild embed setting @param args Command arguments
// if no arguments are present, send error and return // attempt to find command // if command cannot be found, send error and return // found command, generate embed // set command aliases