Skip to content

Commit

Permalink
small optimizations on array getting
Browse files Browse the repository at this point in the history
  • Loading branch information
WholesomeGodList committed Jan 1, 2020
1 parent 76d5805 commit 04d7fbf
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 116 deletions.
27 changes: 13 additions & 14 deletions src/main/java/bot/BotConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,34 @@
import org.json.JSONObject;
import org.json.JSONTokener;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.*;

public class BotConfig {
//This just loads the config of the bot.
static final String PREFIX = readBotPrefix("./config.json");
static final String BOT_TOKEN = readBotToken("./config.json");
static final String PREFIX = readBotPrefix();
static final String BOT_TOKEN = readBotToken();

private static String readBotToken(String fileName) {
private static String readBotToken() {
try {
InputStream is = new FileInputStream(new File(fileName));
InputStream is = new FileInputStream(new File("./config.json"));
JSONObject bruh = new JSONObject(new JSONTokener(is));
return bruh.getString("token");
} catch(IOException e){
System.out.println("Config not found.");
System.err.println("ERROR: Config file not found. Stopping bot...");
System.exit(1);
return "How did you even get here?";
}
return null;
}

private static String readBotPrefix(String fileName) {
private static String readBotPrefix() {
try {
InputStream is = new FileInputStream(new File(fileName));
InputStream is = new FileInputStream(new File("./config.json"));
JSONObject bruh = new JSONObject(new JSONTokener(is));
return bruh.getString("prefix");
} catch(IOException e){
System.out.println("Config not found.");
System.err.println("Prefix not found.");
System.exit(1);
return "If this somehow enters the code I'm suing Java";
}
return null;
}
}
22 changes: 6 additions & 16 deletions src/main/java/bot/commands/IsCommand.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
package bot.commands;

import java.util.ArrayList;
import java.util.Arrays;

public class IsCommand {
private static final ArrayList<String> allCommands = new ArrayList<>(
Arrays.asList(
"help", "tags", "getpage", "info", "read", "badtags", "warningtags", "supportedsites", "sites", "random", "search", "deepsearch", "addhook", "removehook"
)
);
public static boolean isCommand(String query){
ArrayList<String> allCommands = new ArrayList<>();
allCommands.add("help");
allCommands.add("tags");
allCommands.add("getpage");
allCommands.add("info");
allCommands.add("read");
allCommands.add("badtags");
allCommands.add("warningtags");
allCommands.add("supportedsites");
allCommands.add("sites");
allCommands.add("random");
allCommands.add("search");
allCommands.add("deepsearch");
allCommands.add("addhook");
allCommands.add("removehook");

return allCommands.contains(query);
}
}
106 changes: 20 additions & 86 deletions src/main/java/bot/modules/TagList.java
Original file line number Diff line number Diff line change
@@ -1,99 +1,33 @@
package bot.modules;

import java.util.ArrayList;
import java.util.Arrays;

public class TagList {
private static final ArrayList<String> badTags = new ArrayList<>(
Arrays.asList (
"netorare", "netori", "scat", "bestiality", "gigantic", "drugs", "blackmail", "horse", "fisting",
"vore", "guro", "nose hook", "urination", "blood", "cheating", "dog", "pig", "corruption", "mind control",
"vomit", "bbm", "cannibalism", "tentacles", "rape", "snuff", "moral degeneration", "mind break", "humiliation",
"chikan", "ryona", "piss drinking", "prostitution", "cum bath", "infantilism", "unbirth", "abortion",
"eye penetration", "urethra insertion", "chloroform", "parasite", "public use"
)
);

private static final ArrayList<String> nonWholesomeTags = new ArrayList<>(
Arrays.asList (
"amputee", "futanari", "gender bender", "daughter", "human on furry", "group", "lactation", "femdom",
"ffm threesome", "double penetration", "gag", "harem", "collar", "strap-on", "inflation", "mmf threesome", "enema",
"bukkake", "bbw", "dick growth", "big areolae", "huge breasts", "slave", "gaping", "torture", "shemale", "pegging",
"triple penetration", "birth", "prolapse", "human pet", "foot licking", "milking", "bondage", "multiple penises",
"asphyxiation", "stuck in wall", "brain fuck", "human cattle", "clit growth", "ttf threesome", "phimosis", "glory hole"
)
);
public static ArrayList<String> getTagList() {
ArrayList<String> badTags = new ArrayList<String>();
badTags.add("netorare");
badTags.add("netori");
badTags.add("scat");
badTags.add("bestiality");
badTags.add("gigantic");
badTags.add("drugs");
badTags.add("blackmail");
badTags.add("horse");
badTags.add("fisting");
badTags.add("vore");
badTags.add("guro");
badTags.add("nose hook");
badTags.add("urination");
badTags.add("blood");
badTags.add("cheating");
badTags.add("dog");
badTags.add("pig");
badTags.add("corruption");
badTags.add("mind control");
badTags.add("vomit");
badTags.add("bbm");
badTags.add("cannibalism");
badTags.add("tentacles");
badTags.add("rape");
badTags.add("snuff");
badTags.add("moral degeneration");
badTags.add("mind break");
badTags.add("humiliation");
badTags.add("chikan");
badTags.add("ryona");
badTags.add("piss drinking");
badTags.add("prostitution");
badTags.add("cum bath");
badTags.add("infantilism");
badTags.add("unbirth");
badTags.add("abortion");
badTags.add("eye penetration");
badTags.add("urethra insertion");
badTags.add("chloroform");
return badTags;
}

public static ArrayList<String> nonWholesomeTags() {
ArrayList<String> nonWholesomeTags = new ArrayList<>();
nonWholesomeTags.add("amputee");
nonWholesomeTags.add("futanari");
nonWholesomeTags.add("gender bender");
nonWholesomeTags.add("daughter");
nonWholesomeTags.add("human on furry");
nonWholesomeTags.add("group");
nonWholesomeTags.add("lactation");
nonWholesomeTags.add("femdom");
nonWholesomeTags.add("ffm threesome");
nonWholesomeTags.add("double penetration");
nonWholesomeTags.add("gag");
nonWholesomeTags.add("harem");
nonWholesomeTags.add("collar");
nonWholesomeTags.add("strap-on");
nonWholesomeTags.add("inflation");
nonWholesomeTags.add("mmf threesome");
nonWholesomeTags.add("enema");
nonWholesomeTags.add("bukkake");
nonWholesomeTags.add("bbw");
nonWholesomeTags.add("dick growth");
nonWholesomeTags.add("big areolae");
nonWholesomeTags.add("huge breasts");
nonWholesomeTags.add("slave");
nonWholesomeTags.add("gaping");
nonWholesomeTags.add("torture");
nonWholesomeTags.add("shemale");
nonWholesomeTags.add("pegging");
nonWholesomeTags.add("triple penetration");
nonWholesomeTags.add("birth");
nonWholesomeTags.add("prolapse");
nonWholesomeTags.add("human pet");
nonWholesomeTags.add("foot licking");
nonWholesomeTags.add("milking");
nonWholesomeTags.add("bondage");
nonWholesomeTags.add("multiple penises");
nonWholesomeTags.add("asphyxiation");
nonWholesomeTags.add("stuck in wall");
nonWholesomeTags.add("brain fuck");
nonWholesomeTags.add("human cattle");
nonWholesomeTags.add("clit growth");
nonWholesomeTags.add("ttf threesome");
nonWholesomeTags.add("phimosis");
nonWholesomeTags.add("parasite");
nonWholesomeTags.add("public use");
nonWholesomeTags.add("glory hole");
return nonWholesomeTags;
}

Expand Down

0 comments on commit 04d7fbf

Please sign in to comment.