public class PermOverrideManager
extends net.dv8tion.jda.core.managers.impl.ManagerBase
PermissionOverride
.
Example
manager.setDenied(Permission.MESSAGE_WRITE)
.setAllowed(Permission.MESSAGE_READ)
.queue();
manager.reset(PermOverrideManager.DENIED | PermOverrideManager.ALLOWED)
.grant(Permission.MESSAGE_WRITE)
.clear(Permission.MESSAGE_MANAGE)
.queue();
PermissionOverride.getManager()
AuditableRestAction.EmptyRestAction<T>
Modifier and Type | Field | Description |
---|---|---|
static long |
ALLOWED |
Used to reset the granted field
|
static long |
DENIED |
Used to reset the denied field
|
static long |
PERMISSIONS |
Used to reset all permissions to their original value
|
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor | Description |
---|---|
PermOverrideManager(PermissionOverride override) |
Creates a new PermOverrideManager instance
|
Modifier and Type | Method | Description |
---|---|---|
PermOverrideManager |
clear(long permissions) |
Clears the provided
Permissions bits
from the selected PermissionOverride . |
PermOverrideManager |
clear(java.util.Collection<Permission> permissions) |
Clears the provided
Permissions bits
from the selected PermissionOverride . |
PermOverrideManager |
clear(Permission... permissions) |
Clears the provided
Permissions bits
from the selected PermissionOverride . |
PermOverrideManager |
deny(long permissions) |
Denies the provided
Permissions bits
from the selected PermissionOverride . |
PermOverrideManager |
deny(java.util.Collection<Permission> permissions) |
Denies the provided
Permissions
from the selected PermissionOverride . |
PermOverrideManager |
deny(Permission... permissions) |
Denies the provided
Permissions
from the selected PermissionOverride . |
Channel |
getChannel() |
The
Channel this Manager's
PermissionOverride is in. |
Guild |
getGuild() |
|
PermissionOverride |
getPermissionOverride() |
The target
PermissionOverride
that will be modified by this Manager |
PermOverrideManager |
grant(long permissions) |
Grants the provided
Permissions bits
to the selected PermissionOverride . |
PermOverrideManager |
grant(java.util.Collection<Permission> permissions) |
Grants the provided
Permissions
to the selected PermissionOverride . |
PermOverrideManager |
grant(Permission... permissions) |
Grants the provided
Permissions
to the selected PermissionOverride . |
PermOverrideManager |
reset() |
Resets all fields for this manager.
|
PermOverrideManager |
reset(long fields) |
Resets the fields specified by the provided bit-flag pattern.
|
PermOverrideManager |
reset(long... fields) |
Resets the fields specified by the provided bit-flag patterns.
|
reason, setCheck
complete, isPermissionChecksEnabled, queue, setPermissionChecksEnabled
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
complete, completeAfter, getJDA, isPassContext, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfter
public static final long DENIED
public static final long ALLOWED
public static final long PERMISSIONS
public PermOverrideManager(PermissionOverride override)
override
- The PermissionOverride
to managepublic Guild getGuild()
Guild
this Manager's
Channel
is in.
getPermissionOverride().getGuild()
Guild
public Channel getChannel()
Channel
this Manager's
PermissionOverride
is in.
getPermissionOverride().getChannel()
Channel
public PermissionOverride getPermissionOverride()
PermissionOverride
that will be modified by this ManagerPermissionOverride
@CheckReturnValue public PermOverrideManager reset(long fields)
manager.reset(PermOverrideManager.ALLOWED | PermOverrideManager.DENIED);
Flag Constants:
reset
in class net.dv8tion.jda.core.managers.impl.ManagerBase
fields
- Integer value containing the flags to reset.@CheckReturnValue public PermOverrideManager reset(long... fields)
manager.reset(PermOverrideManager.ALLOWED, PermOverrideManager.DENIED);
Flag Constants:
reset
in class net.dv8tion.jda.core.managers.impl.ManagerBase
fields
- Integer values containing the flags to reset.@CheckReturnValue public PermOverrideManager reset()
@CheckReturnValue public PermOverrideManager grant(long permissions)
Permissions
bits
to the selected PermissionOverride
.permissions
- The permissions to grant to the selected PermissionOverride
@CheckReturnValue public PermOverrideManager grant(Permission... permissions)
Permissions
to the selected PermissionOverride
.permissions
- The permissions to grant to the selected PermissionOverride
java.lang.IllegalArgumentException
- If any of the provided Permissions is null
Permission.getRaw(Permission...)
@CheckReturnValue public PermOverrideManager grant(java.util.Collection<Permission> permissions)
Permissions
to the selected PermissionOverride
.permissions
- The permissions to grant to the selected PermissionOverride
java.lang.IllegalArgumentException
- If any of the provided Permissions is null
EnumSet
,
Permission.getRaw(Collection)
@CheckReturnValue public PermOverrideManager deny(long permissions)
Permissions
bits
from the selected PermissionOverride
.permissions
- The permissions to deny from the selected PermissionOverride
@CheckReturnValue public PermOverrideManager deny(Permission... permissions)
Permissions
from the selected PermissionOverride
.permissions
- The permissions to deny from the selected PermissionOverride
java.lang.IllegalArgumentException
- If any of the provided Permissions is null
Permission.getRaw(Permission...)
@CheckReturnValue public PermOverrideManager deny(java.util.Collection<Permission> permissions)
Permissions
from the selected PermissionOverride
.permissions
- The permissions to deny from the selected PermissionOverride
java.lang.IllegalArgumentException
- If any of the provided Permissions is null
EnumSet
,
Permission.getRaw(Collection)
@CheckReturnValue public PermOverrideManager clear(long permissions)
Permissions
bits
from the selected PermissionOverride
.
permissions
- The permissions to clear from the selected PermissionOverride
@CheckReturnValue public PermOverrideManager clear(Permission... permissions)
Permissions
bits
from the selected PermissionOverride
.
permissions
- The permissions to clear from the selected PermissionOverride
java.lang.IllegalArgumentException
- If any of the provided Permissions is null
@CheckReturnValue public PermOverrideManager clear(java.util.Collection<Permission> permissions)
Permissions
bits
from the selected PermissionOverride
.
permissions
- The permissions to clear from the selected PermissionOverride
java.lang.IllegalArgumentException
- If any of the provided Permissions is null
EnumSet
,
Permission.getRaw(Collection)