diff --git a/src/main/java/cc/fascinated/bat/common/RoleUtils.java b/src/main/java/cc/fascinated/bat/common/RoleUtils.java index c6e8ce0..5c2c126 100644 --- a/src/main/java/cc/fascinated/bat/common/RoleUtils.java +++ b/src/main/java/cc/fascinated/bat/common/RoleUtils.java @@ -7,6 +7,7 @@ import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.Role; import java.awt.*; +import java.util.EnumSet; /** * @author Fascinated (fascinated7) @@ -33,7 +34,11 @@ public class RoleUtils { */ public String getFormattedPermissions(Role role) { StringBuilder formattedPermissions = new StringBuilder(); - for (Permission permission : role.getPermissions()) { + EnumSet permissions = role.getPermissions(); + if (permissions.isEmpty()) { + return "`None`"; + } + for (Permission permission : permissions) { formattedPermissions.append("`").append(permission.getName()).append("`, "); } return formattedPermissions.substring(0, formattedPermissions.length() - 2);