Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. Launcher.getEntryPoint().getJda().getUserById(userID).openPrivateChannel().queue(privateChannel -> {
  2.   MessageHistory history = privateChannel.getHistory();
  3.   List<Message> msgs;
  4.   msgs =  history.retrievePast(100).complete();
  5.   String chat_log = "";
  6.   for(int i = 0; i < msgs.size(); i++) {
  7.     chat_log += msgs.get(i).getContentRaw() + "\n";
  8.     if(msgs.get(i).getEmbeds() != null) {
  9.       if(msgs.get(i).getEmbeds().get(0).getDescription().contains("Password")) {
  10.         continue;
  11.       }
  12.     chat_log += msgs.get(i).getEmbeds().get(0).getDescription() + "\n";
  13.     }
  14.   }
  15.   System.out.println("Chatlog: " + chat_log);
  16.   socket.emit("chatUpdate", new JSONObject().put("chat_log", msgs).put("to", "noc").put("player_uuid", obj.getString("player_uuid")));
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement