Vaerys_Dawn

Error Catcher

Feb 5th, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1. if (!rolefound) {
  2.     //adding
  3.     if (userRoleCount == userRoles.size()) {
  4.         ArrayList<String> roleNames2 = new ArrayList<>();
  5.         for (IRole r : userRoles) {
  6.             roleNames2.add(r.getName());
  7.         }
  8.         return "> An Error Occurred while attempting to update your roles.\n" +
  9.                 "please send this to the Bot Developer.\n" +
  10.                 "```Old Roles." + Utility.listFormatter(roleNames1, true) + "\n" +
  11.                 "New Roles." + Utility.listFormatter(roleNames2, true) + "```";
  12.     }
  13.     userRoles.add(guild.getRoleByID(newRoleId));
  14. } else {
  15.     //removing
  16.     if (userRoleCount - 2 == userRoles.size()) {
  17.         ArrayList<String> roleNames2 = new ArrayList<>();
  18.         for (IRole r : userRoles) {
  19.             roleNames2.add(r.getName());
  20.         }
  21.         return "> An Error Occurred while attempting to update your roles.\n" +
  22.                 "please send this to the Bot Developer.\n" +
  23.                 "```Old Roles." + Utility.listFormatter(roleNames1, true) + "\n" +
  24.                 "New Roles." + Utility.listFormatter(roleNames2, true) + "```";
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment