package com.demigodsrpg.chitchatbot;

import com.demigodsrpg.chitchat.Chitchat;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;

import java.util.Arrays;
import java.util.List;
import java.util.Random;

public class BotListener implements Listener {
    private final List<String> HQM = Arrays.asList("HQM", "HmmmQuestionMark", "HandyQuestMarker");
    private final Random RAND = new Random();

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onChat(AsyncPlayerChatEvent event) {
        String message = event.getMessage();
        if (message.toLowerCase().contains("@gustabot")) {
            Bukkit.getScheduler().scheduleAsyncDelayedTask(Bot.INST, () -> {
                String[] parts = message.trim().split("\\s+");
                Chitchat.sendMessage(Bot.PREFIX + Bot.BRAIN.getSentence(parts[RAND.nextInt(parts.length)]));
            }, 30);
        } else if (message.toLowerCase().contains("@senpaibot")) {
            Bukkit.getScheduler().scheduleAsyncDelayedTask(Bot.INST, () -> {
                String[] parts = message.toLowerCase().trim().split("\\s+");
                Chitchat.sendMessage(Bot.SENPAI + Bot.SENPAI_BRAIN.getSentence(parts[RAND.nextInt(parts.length)]));
            }, 30);
        } else if (HQM.contains(event.getPlayer().getName())) {
            Bot.SENPAI_BRAIN.add(message.toLowerCase());
        } else {
            Bot.BRAIN.add(message);
        }
    }
}

@@ -1025,32 +1025,52 @@
         %7D, 30);%0A
+            return;%0A
         %7D else i
@@ -1414,30 +1414,53 @@
 0);%0A        
-%7D else
+    return;%0A        %7D%0A       
  if (HQM.con
@@ -1567,20 +1567,9 @@
    %7D
- else %7B%0A    
+%0A
     
@@ -1596,26 +1596,16 @@
 ssage);%0A
-        %7D%0A
     %7D%0A%7D%0A

Fix how messages are recorded.