mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-24 05:39:44 +00:00
added command to set roles for which experience gain is disabled
and separate command to remove them from the list again added command to see all roles for which experience gain is disabled
This commit is contained in:
@@ -14,11 +14,9 @@ import net.dv8tion.jda.api.entities.Emote;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.utils.cache.CacheFlag;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.security.auth.login.LoginException;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
|
||||
@@ -87,6 +87,11 @@ public class RoleServiceBean implements RoleService {
|
||||
return roles.stream().map(this::getRoleFromGuild).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAnyOfTheRoles(Member member, List<ARole> roles) {
|
||||
return member.getRoles().stream().anyMatch(role1 -> roles.stream().anyMatch(role -> role.getId() == role1.getIdLong()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean memberHasRole(Member member, Role role) {
|
||||
return member.getRoles().stream().anyMatch(role1 -> role1.getIdLong() == role.getIdLong());
|
||||
|
||||
Reference in New Issue
Block a user