forked from Fascinated/Bat
fix log error
This commit is contained in:
parent
b5b306cc6d
commit
4f97e181a7
@ -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<Permission> 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);
|
||||
|
Loading…
Reference in New Issue
Block a user