Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public String execute(String args, CommandObject command) {
- List<IRole> parentRole = Utility.getRolesByName(command.guild,args);
- EnumSet parentPerms = command.guild.getEveryoneRole().getPermissions();
- ArrayList<String> permList = new ArrayList<>();
- String workingID = Utility.sendMessage("`Working...`",command.channel).get();
- if (parentRole.size() != 0){
- parentPerms = parentRole.get(0).getPermissions();
- }
- for (IRole r: command.guild.getRoles()){
- for (RoleTypeObject to: command.guildConfig.getCosmeticRoles()){
- if (r.getID().equals(to.getRoleID())){
- r.changePermissions(parentPerms);
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
- }
- for (Object p : parentPerms.toArray()){
- permList.add(p.toString());
- }
- Utility.deleteMessage(command.client.getMessageByID(workingID));
- return "> Cosmetic Roles Perms set to : " + Utility.listFormatter(permList,true);
- }
Advertisement
Add Comment
Please, Sign In to add comment