Vaerys_Dawn

Issue Found.

Mar 16th, 2017
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.90 KB | None | 0 0
  1. //log without SetNicknameEvent Fired. <<sends 1 User role update event>>
  2.  
  3. 21:18:19.957 [Event Dispatcher Handler] DEBUG Handlers.MessageHandler - COMMAND : "!test", ARGS : "", GUILD : "254790152851816458", CHANNEL : "254790205851041794", USER : "159186011455225856", MESSAGE : "291877759796379649".
  4. 21:18:19.957 [Event Dispatcher Handler] DEBUG Main.Utility - To Match : ADMINISTRATOR.
  5. 21:18:19.957 [Event Dispatcher Handler] DEBUG Main.Utility - User Perms : READ_MESSAGES, SEND_MESSAGES, EMBED_LINKS, ATTACH_FILES, READ_MESSAGE_HISTORY, VOICE_CONNECT, VOICE_SPEAK, VOICE_USE_VAD, CHANGE_NICKNAME.
  6. 21:18:19.957 [Event Dispatcher Handler] DEBUG Main.Utility - Result : false
  7. 21:18:20.719 [Event Dispatcher Handler] INFO  Main.AnnotationListener - Old Roles:
  8. 21:18:20.719 [Event Dispatcher Handler] INFO  Main.AnnotationListener -
  9. 21:18:20.719 [Event Dispatcher Handler] INFO  Main.AnnotationListener - New Roles:
  10. 21:18:20.719 [Event Dispatcher Handler] INFO  Main.AnnotationListener - Red,
  11.  
  12. //Log with SetNicknameEvent Fired. <<Sends 2 user role update events>>
  13. 21:20:07.532 [Event Dispatcher Handler] DEBUG Handlers.MessageHandler - COMMAND : "!test", ARGS : "", GUILD : "254790152851816458", CHANNEL : "254790205851041794", USER : "159186011455225856", MESSAGE : "291878211221192704".
  14. 21:20:07.532 [Event Dispatcher Handler] DEBUG Main.Utility - To Match : ADMINISTRATOR.
  15. 21:20:07.532 [Event Dispatcher Handler] DEBUG Main.Utility - User Perms : READ_MESSAGES, SEND_MESSAGES, EMBED_LINKS, ATTACH_FILES, READ_MESSAGE_HISTORY, VOICE_CONNECT, VOICE_SPEAK, VOICE_USE_VAD, CHANGE_NICKNAME.
  16. 21:20:07.532 [Event Dispatcher Handler] DEBUG Main.Utility - Result : false
  17. 21:20:07.841 [Event Dispatcher Handler] INFO  Main.AnnotationListener - Old Roles:
  18. 21:20:07.841 [Event Dispatcher Handler] INFO  Main.AnnotationListener -
  19. 21:20:07.841 [Event Dispatcher Handler] INFO  Main.AnnotationListener - New Roles:
  20. 21:20:07.841 [Event Dispatcher Handler] INFO  Main.AnnotationListener - Red,
  21. 21:20:08.142 [Event Dispatcher Handler] INFO  Main.AnnotationListener - Old Roles:
  22. 21:20:08.142 [Event Dispatcher Handler] INFO  Main.AnnotationListener - Red,
  23. 21:20:08.142 [Event Dispatcher Handler] INFO  Main.AnnotationListener - New Roles:
  24. 21:20:08.143 [Event Dispatcher Handler] INFO  Main.AnnotationListener -
  25.  
  26. //Code to reproduce
  27.  
  28.     @Override
  29.     public String execute(MessageReceivedEvent e) {
  30.         IUser user = e.getGuild().getUserByID("[UserID]")
  31.         IRole[] roles = new IRole[user.getRolesForGuild(e.getGuild).size + 1];
  32.         int i = 0;
  33.         //adds user's existing roles.
  34.         for (IRole r: user.getRolesForGuild(e.getGuild())){
  35.             roles[i] = r;
  36.             i++;
  37.         }
  38.         //adds new roles
  39.         roles[i] = e.getGuild().getRoleByID("[RoleID]");
  40.         //sends requests.
  41.         e.getGuild.editUserRoles(command.author, roles);
  42.         e.getGuild.setUserNickname(command.author,"Test Was made.");
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment