Package net.dv8tion.jda.api.entities
Interface PermissionOverride
- All Superinterfaces:
ISnowflake
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondelete()
Deletes this PermissionOverride.EnumSet of allPermissions
that are specifically allowed by this override.long
This is the raw binary representation (as a base 10 long) of the permissions allowed by this override.TheGuildChannel
that this PermissionOverride affects.EnumSet of allPermissions
that are denied by this override.long
This is the raw binary representation (as a base 10 long) of the permissions denied by this override.getGuild()
EnumSet of allPermission
that are unaffected by this override.long
This is the raw binary representation (as a base 10 long) of the permissions not affected by this override.getJDA()
TheJDA
instance that this PermissionOverride is related to.Returns thePermissionOverrideAction
to modify this PermissionOverride.This method will return thePermissionHolder
of this PermissionOverride.getRole()
boolean
Used to determine if this PermissionOverride relates to a specificMember
.boolean
Used to determine if this PermissionOverride relates to a specificRole
.Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
getAllowedRaw
long getAllowedRaw()This is the raw binary representation (as a base 10 long) of the permissions allowed by this override.
The long relates to the offsets used by eachPermission
.- Returns:
- Never-negative long containing the binary representation of the allowed permissions of this override.
-
getInheritRaw
long getInheritRaw()This is the raw binary representation (as a base 10 long) of the permissions not affected by this override.
The long relates to the offsets used by eachPermission
.- Returns:
- Never-negative long containing the binary representation of the unaffected permissions of this override.
-
getDeniedRaw
long getDeniedRaw()This is the raw binary representation (as a base 10 long) of the permissions denied by this override.
The long relates to the offsets used by eachPermission
.- Returns:
- Never-negative long containing the binary representation of the denied permissions of this override.
-
getAllowed
EnumSet of allPermissions
that are specifically allowed by this override.
Changes to the returned set do not affect this entity directly.- Returns:
- Possibly-empty set of allowed
Permissions
.
-
getInherit
EnumSet of allPermission
that are unaffected by this override.
Changes to the returned set do not affect this entity directly.- Returns:
- Possibly-empty set of unaffected
Permissions
.
-
getDenied
EnumSet of allPermissions
that are denied by this override.
Changes to the returned set do not affect this entity directly.- Returns:
- Possibly-empty set of denied
Permissions
.
-
getJDA
TheJDA
instance that this PermissionOverride is related to.- Returns:
- Never-null
JDA
instance.
-
getPermissionHolder
This method will return thePermissionHolder
of this PermissionOverride. It can be used to get the general permissions of that PermissionHolder, no matter if it is aMember
or aRole
.
Similar togetMember()
this will returnnull
if the member is not cached.To get the concrete Member or Role, use
getMember()
orgetRole()
!- Returns:
- Possibly-null
IPermissionHolder
of this PermissionOverride. - See Also:
-
getMember
If this PermissionOverride is an override dealing with aMember
, then this method will return the relatedMember
if the member is currently cached.
Otherwise, this method returnsnull
.
Basically: ifisMemberOverride()
returnsfalse
or the member is not cached, this returnsnull
.- Returns:
- Possibly-null related
Member
.
-
getRole
If this PermissionOverride is an override dealing with aRole
, then this method will return the relatedRole
.
Otherwise, this method returnsnull
.
Basically: ifisRoleOverride()
returnsfalse
, this returnsnull
.- Returns:
- Possibly-null related
Role
.
-
getChannel
TheGuildChannel
that this PermissionOverride affects.- Returns:
- Never-null related
GuildChannel
that this override is part of.
-
getGuild
TheGuild
that theGuildChannel
returned fromgetChannel()
is a part of. By inference, this is theGuild
that this PermissionOverride is part of.- Returns:
- Never-null related
Guild
.
-
isMemberOverride
boolean isMemberOverride()Used to determine if this PermissionOverride relates to a specificMember
.- Returns:
- True if this override is a user override.
-
isRoleOverride
boolean isRoleOverride()Used to determine if this PermissionOverride relates to a specificRole
.- Returns:
- True if this override is a role override.
-
getManager
Returns thePermissionOverrideAction
to modify this PermissionOverride.
In the PermissionOverrideAction you can modify the permissions of the override. You modify multiple fields in one request by chaining setters before callingRestAction.queue()
.- Returns:
- The PermissionOverrideAction of this override.
- Throws:
InsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_PERMISSIONS
-
delete
Deletes this PermissionOverride.Possible ErrorResponses include:
ErrorResponse.UNKNOWN_OVERRIDE
If the the override was already deleted.UNKNOWN_CHANNEL
If the channel this override was a part of was already deletedMISSING_ACCESS
If we were removed from the Guild
- Returns:
AuditableRestAction
- Throws:
InsufficientPermissionException
- if we don't have the permission toMANAGE_CHANNEL
-