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

        // create StringBuilder objects for each command type
        StringBuilder info = new StringBuilder();
        StringBuilder fun = new StringBuilder();
        StringBuilder moderation = new StringBuilder();
        StringBuilder admin = new StringBuilder();

        // stream commands and organize by type
        CommandHandler.commands.stream()
                .forEach(command -> {
                    if (command.getType() == CommandType.INFO) {
                        info.append(command.getName()).append(", ");
                    } else if (command.getType() == CommandType.FUN) {
                        fun.append(command.getName()).append(", ");
                    } else if (command.getType() == CommandType.MODERATION) {
                        moderation.append(command.getName()).append(", ");
                    } else if (command.getType() == CommandType.ADMIN) {
                        admin.append(command.getName()).append(", ");
                    }
                });

        // delete last comma and space of each string
        info.delete(info.length() - 2, info.length());
        fun.delete(fun.length() - 2, fun.length());
        moderation.delete(moderation.length() - 2, moderation.length());
        admin.delete(admin.length() - 2, admin.length());

        if (embed) {
            // build embed and send
            EmbedBuilder eb = EmbedCreator.newCommandEmbedMessage(bot);
            eb.setTitle("Bot commands")
                    .setDescription("To run any command, type `" + prefix + "commandName (arguments)`" + "\n" +
                            "To find the proper usage of a command, run `" + prefix + "usage commandName`")
                    .addField("Info", info.toString(), false)
                    .addField("Fun", fun.toString(), false)
                    .addField("Moderation", moderation.toString(), false)
                    .addField("Admin", admin.toString(), false);

            event.getChannel()
                    .sendMessage(eb.build())
                    .queue();
        } else {
            event.getChannel()
                    .sendMessage("**Bot commands:**" + "\n" + "To run any command, type `" + prefix +
                            "commandName (arguments)`" + "\n" + "To find the proper usage of a command, run `" +
                            prefix + "usage commandName`" + "\n\n" + "**Info**" + "\n" + info.toString() + "\n\n" +
                            "**Fun**" + "\n" + fun.toString() + "\n\n" + "**Moderation**" + "\n" + moderation.toString() +
                            "\n\n" + "**Admin**" + "\n" + admin.toString())
                    .queue();
        }
    }
/**
     * Provides a list of bot commands separated by type
     * @param event Discord API message event
     * @param prefix Specific guild bot prefix
     * @param embed Guild embed setting
     * @param args Command arguments
     */
Provides a list of bot commands separated by type
@param event Discord API message event
@param prefix Specific guild bot prefix
@param embed Guild embed setting
@param args Command arguments
Provides a list of bot commands separated by type @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();
        StringBuilder info = new StringBuilder();
        StringBuilder fun = new StringBuilder();
        StringBuilder moderation = new StringBuilder();
        StringBuilder admin = new StringBuilder();
        CommandHandler.commands.stream()
                .forEach(command -> {
                    if (command.getType() == CommandType.INFO) {
                        info.append(command.getName()).append(", ");
                    } else if (command.getType() == CommandType.FUN) {
                        fun.append(command.getName()).append(", ");
                    } else if (command.getType() == CommandType.MODERATION) {
                        moderation.append(command.getName()).append(", ");
                    } else if (command.getType() == CommandType.ADMIN) {
                        admin.append(command.getName()).append(", ");
                    }
                });
        info.delete(info.length() - 2, info.length());
        fun.delete(fun.length() - 2, fun.length());
        moderation.delete(moderation.length() - 2, moderation.length());
        admin.delete(admin.length() - 2, admin.length());
        if (embed) {
            EmbedBuilder eb = EmbedCreator.newCommandEmbedMessage(bot);
            eb.setTitle("Bot commands")
                    .setDescription("To run any command, type `" + prefix + "commandName (arguments)`" + "\n" +
                            "To find the proper usage of a command, run `" + prefix + "usage commandName`")
                    .addField("Info", info.toString(), false)
                    .addField("Fun", fun.toString(), false)
                    .addField("Moderation", moderation.toString(), false)
                    .addField("Admin", admin.toString(), false);
            event.getChannel()
                    .sendMessage(eb.build())
                    .queue();
        } else {
            event.getChannel()
                    .sendMessage("**Bot commands:**" + "\n" + "To run any command, type `" + prefix +
                            "commandName (arguments)`" + "\n" + "To find the proper usage of a command, run `" +
                            prefix + "usage commandName`" + "\n\n" + "**Info**" + "\n" + info.toString() + "\n\n" +
                            "**Fun**" + "\n" + fun.toString() + "\n\n" + "**Moderation**" + "\n" + moderation.toString() +
                            "\n\n" + "**Admin**" + "\n" + admin.toString())
                    .queue();
        }
    }
@ Override public void run ( MessageReceivedEvent event , String prefix , boolean embed , String [ ] args ) { User bot = event . getJDA ( ) . getSelfUser ( ) ; StringBuilder info = new StringBuilder ( ) ; StringBuilder fun = new StringBuilder ( ) ; StringBuilder moderation = new StringBuilder ( ) ; StringBuilder admin = new StringBuilder ( ) ; CommandHandler . commands . stream ( ) . forEach ( command -> { if ( command . getType ( ) == CommandType . INFO ) { info . append ( command . getName ( ) ) . append ( ", " ) ; } else if ( command . getType ( ) == CommandType . FUN ) { fun . append ( command . getName ( ) ) . append ( ", " ) ; } else if ( command . getType ( ) == CommandType . MODERATION ) { moderation . append ( command . getName ( ) ) . append ( ", " ) ; } else if ( command . getType ( ) == CommandType . ADMIN ) { admin . append ( command . getName ( ) ) . append ( ", " ) ; } } ) ; info . delete ( info . length ( ) - 2 , info . length ( ) ) ; fun . delete ( fun . length ( ) - 2 , fun . length ( ) ) ; moderation . delete ( moderation . length ( ) - 2 , moderation . length ( ) ) ; admin . delete ( admin . length ( ) - 2 , admin . length ( ) ) ; if ( embed ) { EmbedBuilder eb = EmbedCreator . newCommandEmbedMessage ( bot ) ; eb . setTitle ( "Bot commands" ) . setDescription ( "To run any command, type `" + prefix + "commandName (arguments)`" + "\n" + "To find the proper usage of a command, run `" + prefix + "usage commandName`" ) . addField ( "Info" , info . toString ( ) , false ) . addField ( "Fun" , fun . toString ( ) , false ) . addField ( "Moderation" , moderation . toString ( ) , false ) . addField ( "Admin" , admin . toString ( ) , false ) ; event . getChannel ( ) . sendMessage ( eb . build ( ) ) . queue ( ) ; } else { event . getChannel ( ) . sendMessage ( "**Bot commands:**" + "\n" + "To run any command, type `" + prefix + "commandName (arguments)`" + "\n" + "To find the proper usage of a command, run `" + prefix + "usage commandName`" + "\n\n" + "**Info**" + "\n" + info . toString ( ) + "\n\n" + "**Fun**" + "\n" + fun . toString ( ) + "\n\n" + "**Moderation**" + "\n" + moderation . toString ( ) + "\n\n" + "**Admin**" + "\n" + admin . toString ( ) ) . queue ( ) ; } }
Provides a list of bot commands separated by type
 @param event Discord API message event
 @param prefix Specific guild bot prefix
 @param embed Guild embed setting
 @param args Command arguments
Provides a list of bot commands separated by type @param event Discord API message event @param prefix Specific guild bot prefix @param embed Guild embed setting @param args Command arguments
// create StringBuilder objects for each command type // stream commands and organize by type // delete last comma and space of each string // build embed and send