diff --git a/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java b/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java index c928088c..55feec8d 100644 --- a/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java +++ b/ArtificialAutism/src/main/java/FunctionLayer/Datahandler.java @@ -179,7 +179,7 @@ public class Datahandler { public void updateStringCache() { try { - checkIfUpdateStrings(true); + checkIfUpdateStrings(); } catch (CustomError ex) { Logger.getLogger(Datahandler.class.getName()).log(Level.SEVERE, null, ex); } @@ -413,7 +413,7 @@ public class Datahandler { return stringIteratorComparator(strmap, strCacheLocal, localJMWEMap, localPipelineAnnotation, localPipelineSentimentAnnotation, localCoreDocumentMap); } - public synchronized void checkIfUpdateStrings(boolean hlStatsMsg) throws CustomError { + public synchronized void checkIfUpdateStrings() throws CustomError { if (stopwatch.elapsed(TimeUnit.SECONDS) >= EXPIRE_TIME_IN_SECONDS || !stopwatch.isRunning()) { ConcurrentMap str = MessageResponseHandler.getStr(); System.out.println("str size: " + str.size()); diff --git a/ArtificialAutism/src/main/java/FunctionLayer/DoStuff.java b/ArtificialAutism/src/main/java/FunctionLayer/DoStuff.java index 503d536f..18f1a7a1 100644 --- a/ArtificialAutism/src/main/java/FunctionLayer/DoStuff.java +++ b/ArtificialAutism/src/main/java/FunctionLayer/DoStuff.java @@ -57,15 +57,13 @@ public class DoStuff { } } List blockLast = event.getMessage().getUserMentions().buffer().blockLast(); + String content = event.getMessage().getContent(); if (!channelpermissionsDenied && blockLast != null) { - String content = event.getMessage().getContent(); - if (blockLast != null) { for (User user : blockLast) { content = content.replace(user.getId().asString(), ""); } - } - MessageResponseHandler.getMessage(content); } + MessageResponseHandler.getMessage(content); boolean mentionedBot = false; if (blockLast != null){ for (User user : blockLast) @@ -80,7 +78,6 @@ public class DoStuff { if (mentionedBot || channelName.contains("general-autism")) { try { String ResponseStr; - String content = event.getMessage().getContent(); ResponseStr = MessageResponseHandler.selectReponseMessage(content, username); if (!ResponseStr.isEmpty()) { System.out.print("\nResponseStr3: " + ResponseStr + "\n"); @@ -93,7 +90,7 @@ public class DoStuff { } new Thread(() -> { try { - Datahandler.instance.checkIfUpdateStrings(false); + Datahandler.instance.checkIfUpdateStrings(); } catch (CustomError ex) { Logger.getLogger(DiscordHandler.class.getName()).log(Level.SEVERE, null, ex); } diff --git a/ArtificialAutism/target/ArtificialAutism-1.0.jar b/ArtificialAutism/target/ArtificialAutism-1.0.jar index 17239d60..92642934 100644 Binary files a/ArtificialAutism/target/ArtificialAutism-1.0.jar and b/ArtificialAutism/target/ArtificialAutism-1.0.jar differ diff --git a/ArtificialAutism/target/classes/FunctionLayer/Datahandler.class b/ArtificialAutism/target/classes/FunctionLayer/Datahandler.class index 1d7f54a0..481fba63 100644 Binary files a/ArtificialAutism/target/classes/FunctionLayer/Datahandler.class and b/ArtificialAutism/target/classes/FunctionLayer/Datahandler.class differ diff --git a/ArtificialAutism/target/classes/FunctionLayer/DoStuff.class b/ArtificialAutism/target/classes/FunctionLayer/DoStuff.class index 5dbdb51f..e83972f5 100644 Binary files a/ArtificialAutism/target/classes/FunctionLayer/DoStuff.class and b/ArtificialAutism/target/classes/FunctionLayer/DoStuff.class differ diff --git a/ArtificialAutism/target/maven-archiver/pom.properties b/ArtificialAutism/target/maven-archiver/pom.properties index 0177e827..32e3f8ea 100644 --- a/ArtificialAutism/target/maven-archiver/pom.properties +++ b/ArtificialAutism/target/maven-archiver/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven -#Sun Nov 01 23:59:26 CET 2020 +#Mon Nov 02 09:03:03 CET 2020 version=1.0 groupId=com.mycompany artifactId=ArtificialAutism