package sig; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import javax.security.auth.login.LoginException; import net.dv8tion.jda.core.JDA; import net.dv8tion.jda.core.JDABuilder; import net.dv8tion.jda.core.entities.Message; import net.dv8tion.jda.core.entities.MessageChannel; import net.dv8tion.jda.core.entities.TextChannel; import net.dv8tion.jda.core.entities.User; import net.dv8tion.jda.core.events.Event; import net.dv8tion.jda.core.events.message.MessageDeleteEvent; import net.dv8tion.jda.core.events.message.MessageReceivedEvent; import net.dv8tion.jda.core.hooks.EventListener; import net.dv8tion.jda.core.hooks.ListenerAdapter; import net.dv8tion.jda.core.requests.RestAction; import sig.utils.FileUtils; public class DivaBot extends ListenerAdapter{ public static String token; public static JDA bot; public static HashMap messageHistory = new HashMap<>(); public static void main(String[] args) throws LoginException, InterruptedException { String[] fileContents = FileUtils.readFromFile("clientToken.txt"); //System.out.println(fileContents[0]); token = fileContents[0]; bot = new JDABuilder(token) .addEventListener(new DivaBot()).build(); bot.awaitReady(); List channels = bot.getTextChannelsByName("bot-tests",true); RestAction> messageHistory = channels.get(0).getHistory().retrievePast(5); messageHistory.queue(history-> { for (int i=0;i