finish moderation
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 2m2s

This commit is contained in:
Lee
2024-07-09 19:46:48 +01:00
parent bc57834366
commit a3f4e2b918
50 changed files with 1312 additions and 137 deletions

View File

@ -26,6 +26,17 @@ public class RoleUtils {
return member.getRoles().stream().anyMatch(r -> r.getPosition() > role.getPosition());
}
/**
* Checks if a member has a higher role than the specified role
*
* @param member the member to check
* @param targetMember the member to check against
* @return if the member has a higher role
*/
public static boolean hasHigherRole(Member member, Member targetMember) {
return member.getRoles().stream().anyMatch(r -> targetMember.getRoles().stream().anyMatch(tr -> tr.getPosition() < r.getPosition()));
}
/**
* Gets the formatted permissions of a role
*