<commit_before>package stream.flarebot.flarebot.commands.secret;

import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.MessageBuilder;
import net.dv8tion.jda.core.entities.Guild;
import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.TextChannel;
import net.dv8tion.jda.core.entities.User;
import stream.flarebot.flarebot.FlareBot;
import stream.flarebot.flarebot.FlareBotManager;
import stream.flarebot.flarebot.commands.Command;
import stream.flarebot.flarebot.commands.CommandType;
import stream.flarebot.flarebot.objects.GuildWrapper;
import stream.flarebot.flarebot.util.MessageUtils;

import java.awt.Color;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;

public class GuildCommand implements Command {

    @Override
    public void onCommand(User sender, GuildWrapper guild, TextChannel channel, Message message, String[] args, Member member) {
        if (args.length == 0) {
            MessageUtils.sendUsage(this, channel, sender);
        } else {
            if (args[0].equalsIgnoreCase("block")) {
                if (args.length == 1) {
                    handleBlock(channel, channel.getGuild().getId(), null);
                } else if (args.length == 2) {
                    handleBlock(channel, args[1], null);
                } else {
                    handleBlock(channel, args[1], FlareBot.getMessage(args, 2));
                }
            } else if (args[0].equalsIgnoreCase("unblock")) {
                if (args.length == 1) {
                    handleUnblock(channel, channel.getGuild().getId());
                } else if (args.length == 2) {
                    handleUnblock(channel, args[1]);
                }
            } else if (args[0].equalsIgnoreCase("status")) {
                if (args.length == 1) {
                    EmbedBuilder embedBuilder = MessageUtils.getEmbed(sender);
                    embedBuilder.setColor(guild.isBlocked() ? Color.RED : Color.GREEN);
                    embedBuilder.setDescription("This guild " +
                            (guild.isBlocked() ? "is blocked!" : "is not blocked!"))
                            .addField("Reason", (guild.getBlockReason() == null ? "No reason provided!" : guild.getBlockReason()), false);
                    channel.sendMessage(embedBuilder.build()).queue();
                    return;
                } else if (args.length == 2) {
                    Guild guild1 = FlareBot.getInstance().getGuildByID(args[1]);
                    if (guild1 == null) {
                        MessageUtils.sendErrorMessage("That guild ID is not valid!", channel);
                        return;
                    }
                    EmbedBuilder embedBuilder = MessageUtils.getEmbed(sender);
                    embedBuilder.setColor(FlareBotManager.getInstance().getGuild(guild1.getId()).isBlocked() ? Color.RED : Color.GREEN);
                    embedBuilder.setDescription("That guild " +
                            (FlareBotManager.getInstance().getGuild(guild1.getId()).isBlocked() ? "is blocked!" : "is not blocked!"))
                            .addField("Reason", (guild.getBlockReason() == null ? "No reason provided!" : guild.getBlockReason()), false);
                    channel.sendMessage(embedBuilder.build()).queue();
                    return;
                }
            } else if (args[0].equalsIgnoreCase("beta")) {
                if (args.length == 1) {
                    guild.setBetaAccess(!guild.getBetaAccess());
                    channel.sendMessage(MessageUtils.getEmbed(sender)
                            .setColor(guild.getBetaAccess() ? Color.GREEN : Color.RED)
                            .setDescription("This guild has successfully been " + (guild.getBetaAccess() ? "given" : "removed from") + " beta access!")
                            .build()).queue();
                    return;
                } else if (args.length == 2) {
                    GuildWrapper guildWrapper = FlareBotManager.getInstance().getGuild(args[0]);
                    if (guildWrapper == null) {
                        MessageUtils.sendErrorMessage("That guild does not exist!", channel);
                        return;
                    } else {
                        guildWrapper.setBetaAccess(!guild.getBetaAccess());
                        channel.sendMessage(MessageUtils.getEmbed(sender)
                                .setColor(guild.getBetaAccess() ? Color.GREEN : Color.RED)
                                .setDescription("The guild `" + guildWrapper.getGuild().getName() + "` has successfully been " + (guild.getBetaAccess() ? "given" : "removed from") + " beta access!")
                                .build()).queue();
                        return;
                    }
                }
            } else if (args[0].equalsIgnoreCase("data")) {
                GuildWrapper wrapper = guild;
                if (args.length == 2)<commit_msg>Update status to have more info<commit_after>package stream.flarebot.flarebot.commands.secret;

import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.MessageBuilder;
import net.dv8tion.jda.core.entities.Guild;
import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.TextChannel;
import net.dv8tion.jda.core.entities.User;
import stream.flarebot.flarebot.FlareBot;
import stream.flarebot.flarebot.FlareBotManager;
import stream.flarebot.flarebot.commands.Command;
import stream.flarebot.flarebot.commands.CommandType;
import stream.flarebot.flarebot.objects.GuildWrapper;
import stream.flarebot.flarebot.util.MessageUtils;

import java.awt.Color;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;

public class GuildCommand implements Command {

    @Override
    public void onCommand(User sender, GuildWrapper guild, TextChannel channel, Message message, String[] args, Member member) {
        if (args.length == 0) {
            MessageUtils.sendUsage(this, channel, sender);
        } else {
            if (args[0].equalsIgnoreCase("block")) {
                if (args.length == 1) {
                    handleBlock(channel, channel.getGuild().getId(), null);
                } else if (args.length == 2) {
                    handleBlock(channel, args[1], null);
                } else {
                    handleBlock(channel, args[1], FlareBot.getMessage(args, 2));
                }
            } else if (args[0].equalsIgnoreCase("unblock")) {
                if (args.length == 1) {
                    handleUnblock(channel, channel.getGuild().getId());
                } else if (args.length == 2) {
                    handleUnblock(channel, args[1]);
                }
            } else if (args[0].equalsIgnoreCase("status")) {
                GuildWrapper wrapper = guild;
                if (args.length == 2) {
                    if (FlareBot.getInstance().getGuildByID(args[1]) == null) {
                        MessageUtils.sendErrorMessage("That guild ID is not valid!", channel);
                        return;
                    }
                    wrapper = FlareBotManager.getInstance().getGuild(args[1]);
                }
                Guild g = guild.getGuild();
                    
                EmbedBuilder embedBuilder = MessageUtils.getEmbed(sender)
                        .setColor(guild.isBlocked() ? Color.RED : Color.GREEN);
                embedBuilder.setTitle(g.getName(), null).addField("Beta", wrapper.getBetaAccess(), true)
                    .addField("Blocked", guild.isBlocked() + (guild.isBlocked() ? " (`" + guild.getBlockedReason() + "`)" : "", true);
                channel.sendMessage(embedBuilder.build()).queue();
            } else if (args[0].equalsIgnoreCase("beta")) {
                if (args.length == 1) {
                    guild.setBetaAccess(!guild.getBetaAccess());
                    channel.sendMessage(MessageUtils.getEmbed(sender)
                            .setColor(guild.getBetaAccess() ? Color.GREEN : Color.RED)
                            .setDescription("This guild has successfully been " + (guild.getBetaAccess() ? "given" : "removed from") + " beta access!")
                            .build()).queue();
                    return;
                } else if (args.length == 2) {
                    GuildWrapper guildWrapper = FlareBotManager.getInstance().getGuild(args[0]);
                    if (guildWrapper == null) {
                        MessageUtils.sendErrorMessage("That guild does not exist!", channel);
                        return;
                    } else {
                        guildWrapper.setBetaAccess(!guild.getBetaAccess());
                        channel.sendMessage(MessageUtils.getEmbed(sender)
                                .setColor(guild.getBetaAccess() ? Color.GREEN : Color.RED)
                                .setDescription("The guild `" + guildWrapper.getGuild().getName() + "` has successfully been " + (guild.getBetaAccess() ? "given" : "removed from") + " beta access!")
                                .build()).queue();
                        return;
                    }
                }
            } else if (args[0].equalsIgnoreCase("data")) {
                GuildWrapper wrapper = guild;
                if (args.length == 2)
{'fraction_non_alphanumeric': 0.12016940179989412, 'fraction_numerical': 0.006352567496029645, 'mean_word_length': 1.832383808095952, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5397798', 'n_tokens_mistral': 2618, 'n_tokens_neox': 2427, 'n_words': 451}