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

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

        // if command is not ran in guild, send error and return
        if (!event.isFromType(ChannelType.TEXT)) {
            EmbedBuilder eb = EmbedCreator.newErrorEmbedMessage(bot, "This command can only be ran in servers.");

            event.getChannel()
                    .sendMessage(eb.build())
                    .queue();
            return;
        }

        Guild guild = event.getGuild();

        // create date and time for guild creation
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMM dd, yyyy hh:mm a");
        LocalDateTime registerTimeCreated = guild.getTimeCreated().toLocalDateTime();

        String creationDate = formatter.format(registerTimeCreated);

        if (embed) {
            EmbedBuilder eb = EmbedCreator.newInfoEmbedMessage(bot);
            eb.setTitle("Server Info: " + guild.getName())
                    .setThumbnail(guild.getIconUrl())
                    .setDescription(guild.getDescription())
                    .addField("ID", guild.getId(), true)
                    .addField("Owner", guild.getOwner().getUser().getAsTag(), true)
                    .addBlankField(true)
                    .addField("Region", guild.getRegion().getName(), true)
                    .addField("Created", creationDate, true)
                    .addField("Boost Tier", guild.getBoostTier().name(), true)
                    .addField("Members", "" + guild.getMembers().size(), true)
                    .addField("Channels", "" + guild.getChannels().size(), true)
                    .addField("Emojis", "" + guild.getEmotes().size(), true);

            event.getChannel()
                    .sendMessage(eb.build())
                    .queue();
        } else {
            event.getChannel()
                    .sendMessage("**Server Info:** " + guild.getName() + "\n\n" + "**ID:** " + guild.getId() +
                            "\n" + "**Owner:** " + guild.getOwner().getUser().getAsTag() + "\n" + "**Region:** " +
                            guild.getRegion().getName() + "\n" + "**Created:** " + creationDate + "\n" +
                            "**Boost Tier:** " + guild.getBoostTier().name() + "\n" + "**Members:** " +
                            guild.getMembers().size() + "\n" + "**Channels:** " + guild.getChannels().size() +
                            "\n" + "**Emojis:** " + guild.getEmotes().size())
                    .queue();
        }
    }
/**
     * If ran in guild, provides information on it
     * @param event Discord API message event
     * @param prefix Specific guild bot prefix
     * @param embed Guild embed setting
     * @param args Command arguments
     */
If ran in guild, provides information on it
@param event Discord API message event
@param prefix Specific guild bot prefix
@param embed Guild embed setting
@param args Command arguments
If ran in guild provides information on it @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 (!event.isFromType(ChannelType.TEXT)) {
            EmbedBuilder eb = EmbedCreator.newErrorEmbedMessage(bot, "This command can only be ran in servers.");
            event.getChannel()
                    .sendMessage(eb.build())
                    .queue();
            return;
        }
        Guild guild = event.getGuild();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMM dd, yyyy hh:mm a");
        LocalDateTime registerTimeCreated = guild.getTimeCreated().toLocalDateTime();
        String creationDate = formatter.format(registerTimeCreated);
        if (embed) {
            EmbedBuilder eb = EmbedCreator.newInfoEmbedMessage(bot);
            eb.setTitle("Server Info: " + guild.getName())
                    .setThumbnail(guild.getIconUrl())
                    .setDescription(guild.getDescription())
                    .addField("ID", guild.getId(), true)
                    .addField("Owner", guild.getOwner().getUser().getAsTag(), true)
                    .addBlankField(true)
                    .addField("Region", guild.getRegion().getName(), true)
                    .addField("Created", creationDate, true)
                    .addField("Boost Tier", guild.getBoostTier().name(), true)
                    .addField("Members", "" + guild.getMembers().size(), true)
                    .addField("Channels", "" + guild.getChannels().size(), true)
                    .addField("Emojis", "" + guild.getEmotes().size(), true);
            event.getChannel()
                    .sendMessage(eb.build())
                    .queue();
        } else {
            event.getChannel()
                    .sendMessage("**Server Info:** " + guild.getName() + "\n\n" + "**ID:** " + guild.getId() +
                            "\n" + "**Owner:** " + guild.getOwner().getUser().getAsTag() + "\n" + "**Region:** " +
                            guild.getRegion().getName() + "\n" + "**Created:** " + creationDate + "\n" +
                            "**Boost Tier:** " + guild.getBoostTier().name() + "\n" + "**Members:** " +
                            guild.getMembers().size() + "\n" + "**Channels:** " + guild.getChannels().size() +
                            "\n" + "**Emojis:** " + guild.getEmotes().size())
                    .queue();
        }
    }
@ Override public void run ( MessageReceivedEvent event , String prefix , boolean embed , String [ ] args ) { User bot = event . getJDA ( ) . getSelfUser ( ) ; if ( ! event . isFromType ( ChannelType . TEXT ) ) { EmbedBuilder eb = EmbedCreator . newErrorEmbedMessage ( bot , "This command can only be ran in servers." ) ; event . getChannel ( ) . sendMessage ( eb . build ( ) ) . queue ( ) ; return ; } Guild guild = event . getGuild ( ) ; DateTimeFormatter formatter = DateTimeFormatter . ofPattern ( "MMM dd, yyyy hh:mm a" ) ; LocalDateTime registerTimeCreated = guild . getTimeCreated ( ) . toLocalDateTime ( ) ; String creationDate = formatter . format ( registerTimeCreated ) ; if ( embed ) { EmbedBuilder eb = EmbedCreator . newInfoEmbedMessage ( bot ) ; eb . setTitle ( "Server Info: " + guild . getName ( ) ) . setThumbnail ( guild . getIconUrl ( ) ) . setDescription ( guild . getDescription ( ) ) . addField ( "ID" , guild . getId ( ) , true ) . addField ( "Owner" , guild . getOwner ( ) . getUser ( ) . getAsTag ( ) , true ) . addBlankField ( true ) . addField ( "Region" , guild . getRegion ( ) . getName ( ) , true ) . addField ( "Created" , creationDate , true ) . addField ( "Boost Tier" , guild . getBoostTier ( ) . name ( ) , true ) . addField ( "Members" , "" + guild . getMembers ( ) . size ( ) , true ) . addField ( "Channels" , "" + guild . getChannels ( ) . size ( ) , true ) . addField ( "Emojis" , "" + guild . getEmotes ( ) . size ( ) , true ) ; event . getChannel ( ) . sendMessage ( eb . build ( ) ) . queue ( ) ; } else { event . getChannel ( ) . sendMessage ( "**Server Info:** " + guild . getName ( ) + "\n\n" + "**ID:** " + guild . getId ( ) + "\n" + "**Owner:** " + guild . getOwner ( ) . getUser ( ) . getAsTag ( ) + "\n" + "**Region:** " + guild . getRegion ( ) . getName ( ) + "\n" + "**Created:** " + creationDate + "\n" + "**Boost Tier:** " + guild . getBoostTier ( ) . name ( ) + "\n" + "**Members:** " + guild . getMembers ( ) . size ( ) + "\n" + "**Channels:** " + guild . getChannels ( ) . size ( ) + "\n" + "**Emojis:** " + guild . getEmotes ( ) . size ( ) ) . queue ( ) ; } }
If ran in guild, provides information on it
 @param event Discord API message event
 @param prefix Specific guild bot prefix
 @param embed Guild embed setting
 @param args Command arguments
If ran in guild provides information on it @param event Discord API message event @param prefix Specific guild bot prefix @param embed Guild embed setting @param args Command arguments
// if command is not ran in guild, send error and return // create date and time for guild creation