use of io.discloader.discloader.core.entity.Permission in project DiscLoader by R3alCl0ud.
the class GuildChannel method permissionsOf.
@Override
public IPermission permissionsOf(IGuildMember member) {
long raw = 0;
if (getGuild().isOwner(member))
return new Permission(member, this, 2146958463);
for (IRole role : member.getRoles()) {
if (role != null) {
raw |= role.getPermissions().toLong();
}
}
for (IOverwrite overwrite : overwritesOf(member)) {
raw |= overwrite.getAllowed();
raw &= ~overwrite.getDenied();
}
return new Permission(member, this, raw);
}
Aggregations