fix log error
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 56s

This commit is contained in:
Lee 2024-07-05 19:43:18 +01:00
parent b5b306cc6d
commit 4f97e181a7

@ -7,6 +7,7 @@ import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Role; import net.dv8tion.jda.api.entities.Role;
import java.awt.*; import java.awt.*;
import java.util.EnumSet;
/** /**
* @author Fascinated (fascinated7) * @author Fascinated (fascinated7)
@ -33,7 +34,11 @@ public class RoleUtils {
*/ */
public String getFormattedPermissions(Role role) { public String getFormattedPermissions(Role role) {
StringBuilder formattedPermissions = new StringBuilder(); 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("`, "); formattedPermissions.append("`").append(permission.getName()).append("`, ");
} }
return formattedPermissions.substring(0, formattedPermissions.length() - 2); return formattedPermissions.substring(0, formattedPermissions.length() - 2);