Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Launcher.getEntryPoint().getJda().getUserById(userID).openPrivateChannel().queue(privateChannel -> {
- MessageHistory history = privateChannel.getHistory();
- List<Message> msgs;
- msgs = history.retrievePast(100).complete();
- String chat_log = "";
- for(int i = 0; i < msgs.size(); i++) {
- chat_log += msgs.get(i).getContentRaw() + "\n";
- if(msgs.get(i).getEmbeds() != null) {
- if(msgs.get(i).getEmbeds().get(0).getDescription().contains("Password")) {
- continue;
- }
- chat_log += msgs.get(i).getEmbeds().get(0).getDescription() + "\n";
- }
- }
- System.out.println("Chatlog: " + chat_log);
- socket.emit("chatUpdate", new JSONObject().put("chat_log", msgs).put("to", "noc").put("player_uuid", obj.getString("player_uuid")));
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement