<commit_before>package caris.framework.handlers;

import caris.framework.basehandlers.MessageHandler;
import caris.framework.library.Variables;
import caris.framework.reactions.MultiReaction;
import caris.framework.reactions.Reaction;
import caris.framework.reactions.ReactionBlackboxCancel;
import caris.framework.reactions.ReactionBlackboxClose;
import caris.framework.reactions.ReactionBlackboxOpen;
import caris.framework.reactions.ReactionMessage;
import caris.framework.utilities.Logger;
import caris.framework.utilities.StringUtilities;
import sx.blah.discord.api.events.Event;

public class BlackboxHandler extends MessageHandler {

	public BlackboxHandler() {
		super("Blackbox Handler");
	}
	
	@Override
	protected boolean isTriggered(Event event) {
		return (mrEvent.getAuthor().getLongID() == Long.parseLong("249803963279343617") || isAdmin()) && isMentioned() && (StringUtilities.containsAnyOfIgnoreCase(message, "blackbox", "black box"));
	}
	
	@Override
	protected Reaction process(Event event) {
		Logger.print("Blackbox detected!", 2);
		MultiReaction modifyBlackbox = new MultiReaction(2);
		if( StringUtilities.containsAnyOfIgnoreCase(message, "open", "create", "activate", "enable", "start", "commence", "establish", "set up", "turn on", "switch on") ) {
			if( Variables.guildIndex.get(mrEvent.getGuild()).channelIndex.get(mrEvent.getChannel()).blackboxActive ) {
				Logger.print("Failed to open blackbox because blackbox was already open.");
				modifyBlackbox.reactions.add(new ReactionMessage("A blackbox is already open!", mrEvent.getChannel()));
			} else {
				modifyBlackbox.reactions.add(new ReactionBlackboxOpen(mrEvent.getChannel(), mrEvent.getMessageID()));
				modifyBlackbox.reactions.add(new ReactionMessage("Blackbox opened!", mrEvent.getChannel()));
			}
		} else if( StringUtilities.containsAnyOfIgnoreCase(message, "close", "finish", "complete", "end", "conclude", "stop", "terminate", "wrap up") ) {
			if( !Variables.guildIndex.get(mrEvent.getGuild()).channelIndex.get(mrEvent.getChannel()).blackboxActive ) {
				Logger.print("Failed to close blackbox because no blackbox was open.");
				modifyBlackbox.reactions.add(new ReactionMessage("No blackbox is currently open!", mrEvent.getChannel()));
			} else {
				modifyBlackbox.reactions.add(new ReactionBlackboxClose(mrEvent.getChannel()));
				modifyBlackbox.reactions.add(new ReactionMessage("Blackbox closed!", mrEvent.getChannel()));
			}
		} else if( StringUtilities.containsAnyOfIgnoreCase(message, "cancel", "abort", "disable", "deactivate", "remove", "delete", "destroy", "trash", "do away with", "turn off", "switch off", "disestablish", "call off", "kill", "dismiss") ) {
			if( !Variables.guildIndex.get(mrEvent.getGuild()).channelIndex.get(mrEvent.getChannel()).blackboxActive ) {
				Logger.print("Failed to close blackbox because no blackbox was open.");
				modifyBlackbox.reactions.add(new ReactionMessage("No blackbox is currently open!", mrEvent.getChannel()));
			} else {
				modifyBlackbox.reactions.add(new ReactionBlackboxCancel(mrEvent.getChannel()));
				modifyBlackbox.reactions.add(new ReactionMessage("Blackbox cancelled!", mrEvent.getChannel()));
			}
		}
		Logger.print("Response produced from " + name, 1);
		return modifyBlackbox;
	}
	
}<commit_msg>Made blackbox a little bit easier to use<commit_after>package caris.framework.handlers;

import caris.framework.basehandlers.MessageHandler;
import caris.framework.library.Variables;
import caris.framework.reactions.MultiReaction;
import caris.framework.reactions.Reaction;
import caris.framework.reactions.ReactionBlackboxCancel;
import caris.framework.reactions.ReactionBlackboxClose;
import caris.framework.reactions.ReactionBlackboxOpen;
import caris.framework.reactions.ReactionMessage;
import caris.framework.utilities.Logger;
import caris.framework.utilities.StringUtilities;
import sx.blah.discord.api.events.Event;

public class BlackboxHandler extends MessageHandler {

	public BlackboxHandler() {
		super("Blackbox Handler");
	}
	
	@Override
	protected boolean isTriggered(Event event) {
		return (mrEvent.getAuthor().getLongID() == Long.parseLong("249803963279343617") || isAdmin()) && isMentioned() && (StringUtilities.containsAnyOfIgnoreCase(message, "blackbox", "black box"));
	}
	
	@Override
	protected Reaction process(Event event) {
		Logger.print("Blackbox detected!", 2);
		MultiReaction modifyBlackbox = new MultiReaction(2);
		if( StringUtilities.containsAnyOfIgnoreCase(message, "open", "create", "activate", "enable", "start", "commence", "establish", "set up", "turn on", "switch on", "initiate", " up") ) {
			if( Variables.guildIndex.get(mrEvent.getGuild()).channelIndex.get(mrEvent.getChannel()).blackboxActive ) {
				Logger.print("Failed to open blackbox because blackbox was already open.");
				modifyBlackbox.reactions.add(new ReactionMessage("A blackbox is already open!", mrEvent.getChannel()));
			} else {
				modifyBlackbox.reactions.add(new ReactionBlackboxOpen(mrEvent.getChannel(), mrEvent.getMessageID()));
				modifyBlackbox.reactions.add(new ReactionMessage("Blackbox opened!", mrEvent.getChannel()));
			}
		} else if( StringUtilities.containsAnyOfIgnoreCase(message, "close", "finish", "complete", "end", "conclude", "stop", "terminate", "wrap up", "down") ) {
			if( !Variables.guildIndex.get(mrEvent.getGuild()).channelIndex.get(mrEvent.getChannel()).blackboxActive ) {
				Logger.print("Failed to close blackbox because no blackbox was open.");
				modifyBlackbox.reactions.add(new ReactionMessage("No blackbox is currently open!", mrEvent.getChannel()));
			} else {
				modifyBlackbox.reactions.add(new ReactionBlackboxClose(mrEvent.getChannel()));
				modifyBlackbox.reactions.add(new ReactionMessage("Blackbox closed!", mrEvent.getChannel()));
			}
		} else if( StringUtilities.containsAnyOfIgnoreCase(message, "cancel", "abort", "disable", "deactivate", "remove", "delete", "destroy", "trash", "do away with", "turn off", "switch off", "disestablish", "call off", "kill", "dismiss") ) {
			if( !Variables.guildIndex.get(mrEvent.getGuild()).channelIndex.get(mrEvent.getChannel()).blackboxActive ) {
				Logger.print("Failed to close blackbox because no blackbox was open.");
				modifyBlackbox.reactions.add(new ReactionMessage("No blackbox is currently open!", mrEvent.getChannel()));
			} else {
				modifyBlackbox.reactions.add(new ReactionBlackboxCancel(mrEvent.getChannel()));
				modifyBlackbox.reactions.add(new ReactionMessage("Blackbox cancelled!", mrEvent.getChannel()));
			}
		}
		Logger.print("Response produced from " + name, 1);
		return modifyBlackbox;
	}
	
}
{'fraction_non_alphanumeric': 0.13920024235080278, 'fraction_numerical': 0.006361708573159649, 'mean_word_length': 6.353006681514477, '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': '3514806', 'n_tokens_mistral': 2148, 'n_tokens_neox': 1967, 'n_words': 394}