Skip to content

Commit

Permalink
Fix FLR-22
Browse files Browse the repository at this point in the history
  • Loading branch information
SeveralCircles committed Jul 31, 2024
1 parent c488d1e commit 4570de6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Binary file modified .gradle/8.5/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class MessageEvent extends ListenerAdapter implements FlamesDiscordEvent
@Override
public void onMessageReceived(@NotNull MessageReceivedEvent event) {
Logger.getGlobal().log(Level.FINE,event.getAuthor().getId() + " Triggered Message Event");
if (event.getMessage().getContentRaw().matches("[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)")) return; // Don't process URLs
super.onMessageReceived(event);
User user = event.getAuthor();
Logger logger = Logger.getGlobal();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public static List<Entity> analyzeEntities(String message) throws IOException {

AnalyzeEntitiesResponse response = language.analyzeEntities(request);
// Print the response
response.getEntitiesList().forEach((element) -> {
List<Entity> finalList = response.getEntitiesList();
finalList.removeIf(entity -> entity.getName().matches("\\d+"));
finalList.forEach((element) -> {
if (!entityCache.containsKey(element.getName())) entityCache.put(element.getName(), 1);
else entityCache.put(element.getName(), entityCache.get(element.getName()) + 1);
});
});
language.shutdownNow();
//noinspection StatementWithEmptyBody
while (!language.isShutdown()) {}
return response.getEntitiesList();
return finalList;
}
}

0 comments on commit 4570de6

Please sign in to comment.