Package net.dv8tion.jda.api.managers
Interface PermOverrideManager
- All Superinterfaces:
AuditableRestAction<Void>
,Manager<PermOverrideManager>
,RestAction<Void>
Manager providing functionality to update one or more fields for a
PermissionOverride
.
Example
manager.setDenied(Permission.MESSAGE_SEND)
.setAllowed(Permission.VIEW_CHANNEL)
.queue();
manager.reset(PermOverrideManager.DENIED | PermOverrideManager.ALLOWED)
.grant(Permission.MESSAGE_SEND)
.clear(Permission.MESSAGE_MANAGE)
.queue();
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
Used to reset the granted fieldstatic final long
Used to reset the denied fieldstatic final long
Used to reset all permissions to their original valueFields inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
MAX_REASON_LENGTH
-
Method Summary
Modifier and TypeMethodDescriptionclear
(long permissions) Clears the providedPermissions
bits from the selectedPermissionOverride
.default PermOverrideManager
clear
(Collection<Permission> permissions) Clears the providedPermissions
bits from the selectedPermissionOverride
.default PermOverrideManager
clear
(Permission... permissions) Clears the providedPermissions
bits from the selectedPermissionOverride
.deny
(long permissions) Denies the providedPermissions
bits from the selectedPermissionOverride
.default PermOverrideManager
deny
(Collection<Permission> permissions) Denies the providedPermissions
from the selectedPermissionOverride
.default PermOverrideManager
deny
(Permission... permissions) Denies the providedPermissions
from the selectedPermissionOverride
.default IPermissionContainerUnion
TheGuildChannel
this Manager'sPermissionOverride
is in.default Guild
getGuild()
TheGuild
this Manager'sGuildChannel
is in.The targetPermissionOverride
that will be modified by this Managergrant
(long permissions) Grants the providedPermissions
bits to the selectedPermissionOverride
.default PermOverrideManager
grant
(Collection<Permission> permissions) Grants the providedPermissions
to the selectedPermissionOverride
.default PermOverrideManager
grant
(Permission... permissions) Grants the providedPermissions
to the selectedPermissionOverride
.reset
(long fields) Resets the fields specified by the provided bit-flag pattern.reset
(long... fields) Resets the fields specified by the provided bit-flag patterns.Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reason
Methods inherited from interface net.dv8tion.jda.api.managers.Manager
deadline, reset, setCheck, timeout
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
addCheck, and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, onSuccess, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
Field Details
-
DENIED
static final long DENIEDUsed to reset the denied field- See Also:
-
ALLOWED
static final long ALLOWEDUsed to reset the granted field- See Also:
-
PERMISSIONS
static final long PERMISSIONSUsed to reset all permissions to their original value- See Also:
-
-
Method Details
-
reset
Resets the fields specified by the provided bit-flag pattern. You can specify a combination by using a bitwise OR concat of the flag constants.
Example:manager.reset(PermOverrideManager.ALLOWED | PermOverrideManager.DENIED);
Flag Constants:
- Specified by:
reset
in interfaceManager<PermOverrideManager>
- Parameters:
fields
- Integer value containing the flags to reset.- Returns:
- PermOverrideManager for chaining convenience
-
reset
Resets the fields specified by the provided bit-flag patterns.
Example:manager.reset(PermOverrideManager.ALLOWED, PermOverrideManager.DENIED);
Flag Constants:
- Specified by:
reset
in interfaceManager<PermOverrideManager>
- Parameters:
fields
- Integer values containing the flags to reset.- Returns:
- PermOverrideManager for chaining convenience
-
getGuild
TheGuild
this Manager'sGuildChannel
is in.
This is logically the same as callinggetPermissionOverride().getGuild()
- Returns:
- The parent
Guild
-
getChannel
TheGuildChannel
this Manager'sPermissionOverride
is in.
This is logically the same as callinggetPermissionOverride().getChannel()
- Returns:
- The parent
GuildChannel
-
getPermissionOverride
The targetPermissionOverride
that will be modified by this Manager- Returns:
- The target
PermissionOverride
-
grant
Grants the providedPermissions
bits to the selectedPermissionOverride
.- Parameters:
permissions
- The permissions to grant to the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
-
grant
Grants the providedPermissions
to the selectedPermissionOverride
.- Parameters:
permissions
- The permissions to grant to the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
- Throws:
IllegalArgumentException
- If any of the provided Permissions isnull
- See Also:
-
grant
@Nonnull @CheckReturnValue default PermOverrideManager grant(@Nonnull Collection<Permission> permissions) Grants the providedPermissions
to the selectedPermissionOverride
.- Parameters:
permissions
- The permissions to grant to the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
- Throws:
IllegalArgumentException
- If any of the provided Permissions isnull
- See Also:
-
deny
Denies the providedPermissions
bits from the selectedPermissionOverride
.- Parameters:
permissions
- The permissions to deny from the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
-
deny
Denies the providedPermissions
from the selectedPermissionOverride
.- Parameters:
permissions
- The permissions to deny from the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
- Throws:
IllegalArgumentException
- If any of the provided Permissions isnull
- See Also:
-
deny
@Nonnull @CheckReturnValue default PermOverrideManager deny(@Nonnull Collection<Permission> permissions) Denies the providedPermissions
from the selectedPermissionOverride
.- Parameters:
permissions
- The permissions to deny from the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
- Throws:
IllegalArgumentException
- If any of the provided Permissions isnull
- See Also:
-
clear
Clears the providedPermissions
bits from the selectedPermissionOverride
.
This will cause the provided Permissions to be inherited- Parameters:
permissions
- The permissions to clear from the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
-
clear
Clears the providedPermissions
bits from the selectedPermissionOverride
.
This will cause the provided Permissions to be inherited- Parameters:
permissions
- The permissions to clear from the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
- Throws:
IllegalArgumentException
- If any of the provided Permissions isnull
-
clear
@Nonnull @CheckReturnValue default PermOverrideManager clear(@Nonnull Collection<Permission> permissions) Clears the providedPermissions
bits from the selectedPermissionOverride
.
This will cause the provided Permissions to be inherited- Parameters:
permissions
- The permissions to clear from the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
- Throws:
IllegalArgumentException
- If any of the provided Permissions isnull
- See Also:
-