cleaning up code, added multi sentence support, build out caches, did other stuff i forgot

This commit is contained in:
jenzur
2019-04-20 00:17:18 +02:00
parent f6da878ac0
commit 414806aa1f
12 changed files with 262 additions and 1389 deletions
@@ -33,7 +33,7 @@ import org.javacord.api.entity.user.User;
*/
public class DiscordHandler {
private static String MostRecentMsg = "how are you today bot";
private static String MostRecentMsg = "";
public static void main(String[] args) {
System.setProperty("java.util.concurrent.ForkJoinPool.common.parallelism", "25");
@@ -49,8 +49,8 @@ public class DiscordHandler {
Datahandler.instance.shiftReduceParserInitiate();
Datahandler.instance.instantiateAnnotationMap();
System.out.println("FINISHED ALL ANNOTATIONS");
Datahandler.instance.addHLstatsMessages();
Datahandler.instance.updateStringCache();
//Datahandler.instance.addHLstatsMessages();
//Datahandler.instance.updateStringCache();
String token = "NTI5NzAxNTk5NjAyMjc4NDAx.Dw0vDg.7-aMjVWdQMYPl8qVNyvTCPS5F_A";
DiscordApi api = new DiscordApiBuilder().setToken(token).login().join();
api.addMessageCreateListener(event -> {
@@ -92,17 +92,17 @@ public class DiscordHandler {
event.getChannel().sendMessage(ResponseStr);
MostRecentMsg = ResponseStr;
}
new Thread(() -> {
try {
Datahandler.instance.checkIfUpdateStrings(false);
} catch (CustomError ex) {
Logger.getLogger(DiscordHandler.class.getName()).log(Level.SEVERE, null, ex);
}
}).start();
} catch (CustomError ex) {
Logger.getLogger(DiscordHandler.class.getName()).log(Level.SEVERE, null, ex);
}
}
new Thread(() -> {
try {
Datahandler.instance.checkIfUpdateStrings(false);
} catch (CustomError ex) {
Logger.getLogger(DiscordHandler.class.getName()).log(Level.SEVERE, null, ex);
}
}).start();
}
});
}