Package net.dv8tion.jda.api.managers
Interface PermOverrideManager
-
- All Superinterfaces:
AuditableRestAction<java.lang.Void>
,Manager<PermOverrideManager>
,RestAction<java.lang.Void>
public interface PermOverrideManager extends Manager<PermOverrideManager>
Manager providing functionality to update one or more fields for aPermissionOverride
.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();
- See Also:
PermissionOverride.getManager()
-
-
Field Summary
Fields Modifier and Type Field Description static long
ALLOWED
Used to reset the granted fieldstatic long
DENIED
Used to reset the denied fieldstatic long
PERMISSIONS
Used to reset all permissions to their original value
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description PermOverrideManager
clear(long permissions)
Clears the providedPermissions
bits from the selectedPermissionOverride
.default PermOverrideManager
clear(java.util.Collection<Permission> permissions)
Clears the providedPermissions
bits from the selectedPermissionOverride
.default PermOverrideManager
clear(Permission... permissions)
Clears the providedPermissions
bits from the selectedPermissionOverride
.PermOverrideManager
deny(long permissions)
Denies the providedPermissions
bits from the selectedPermissionOverride
.default PermOverrideManager
deny(java.util.Collection<Permission> permissions)
Denies the providedPermissions
from the selectedPermissionOverride
.default PermOverrideManager
deny(Permission... permissions)
Denies the providedPermissions
from the selectedPermissionOverride
.default GuildChannel
getChannel()
TheGuildChannel
this Manager'sPermissionOverride
is in.default Guild
getGuild()
TheGuild
this Manager'sGuildChannel
is in.PermissionOverride
getPermissionOverride()
The targetPermissionOverride
that will be modified by this ManagerPermOverrideManager
grant(long permissions)
Grants the providedPermissions
bits to the selectedPermissionOverride
.default PermOverrideManager
grant(java.util.Collection<Permission> permissions)
Grants the providedPermissions
to the selectedPermissionOverride
.default PermOverrideManager
grant(Permission... permissions)
Grants the providedPermissions
to the selectedPermissionOverride
.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.-
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, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
-
-
-
Field Detail
-
DENIED
static final long DENIED
Used to reset the denied field- See Also:
- Constant Field Values
-
ALLOWED
static final long ALLOWED
Used to reset the granted field- See Also:
- Constant Field Values
-
PERMISSIONS
static final long PERMISSIONS
Used to reset all permissions to their original value- See Also:
- Constant Field Values
-
-
Method Detail
-
reset
@Nonnull PermOverrideManager reset(long fields)
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
@Nonnull PermOverrideManager reset(long... fields)
Resets the fields specified by the provided bit-flag patterns. 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 values containing the flags to reset.- Returns:
- PermOverrideManager for chaining convenience
-
getGuild
@Nonnull default Guild getGuild()
TheGuild
this Manager'sGuildChannel
is in.
This is logically the same as callinggetPermissionOverride().getGuild()
- Returns:
- The parent
Guild
-
getChannel
@Nonnull default GuildChannel getChannel()
TheGuildChannel
this Manager'sPermissionOverride
is in.
This is logically the same as callinggetPermissionOverride().getChannel()
- Returns:
- The parent
GuildChannel
-
getPermissionOverride
@Nonnull PermissionOverride getPermissionOverride()
The targetPermissionOverride
that will be modified by this Manager- Returns:
- The target
PermissionOverride
-
grant
@Nonnull @CheckReturnValue PermOverrideManager grant(long permissions)
Grants the providedPermissions
bits to the selectedPermissionOverride
.- Parameters:
permissions
- The permissions to grant to the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
-
grant
@Nonnull @CheckReturnValue default PermOverrideManager grant(@Nonnull Permission... permissions)
Grants the providedPermissions
to the selectedPermissionOverride
.- Parameters:
permissions
- The permissions to grant to the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If any of the provided Permissions isnull
- See Also:
Permission.getRaw(Permission...)
-
grant
@Nonnull @CheckReturnValue default PermOverrideManager grant(@Nonnull java.util.Collection<Permission> permissions)
Grants the providedPermissions
to the selectedPermissionOverride
.- Parameters:
permissions
- The permissions to grant to the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If any of the provided Permissions isnull
- See Also:
EnumSet
,Permission.getRaw(Collection)
-
deny
@Nonnull @CheckReturnValue PermOverrideManager deny(long permissions)
Denies the providedPermissions
bits from the selectedPermissionOverride
.- Parameters:
permissions
- The permissions to deny from the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
-
deny
@Nonnull @CheckReturnValue default PermOverrideManager deny(@Nonnull Permission... permissions)
Denies the providedPermissions
from the selectedPermissionOverride
.- Parameters:
permissions
- The permissions to deny from the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If any of the provided Permissions isnull
- See Also:
Permission.getRaw(Permission...)
-
deny
@Nonnull @CheckReturnValue default PermOverrideManager deny(@Nonnull java.util.Collection<Permission> permissions)
Denies the providedPermissions
from the selectedPermissionOverride
.- Parameters:
permissions
- The permissions to deny from the selectedPermissionOverride
- Returns:
- PermOverrideManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If any of the provided Permissions isnull
- See Also:
EnumSet
,Permission.getRaw(Collection)
-
clear
@Nonnull @CheckReturnValue PermOverrideManager clear(long 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
-
clear
@Nonnull @CheckReturnValue default PermOverrideManager clear(@Nonnull 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:
java.lang.IllegalArgumentException
- If any of the provided Permissions isnull
-
clear
@Nonnull @CheckReturnValue default PermOverrideManager clear(@Nonnull java.util.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:
java.lang.IllegalArgumentException
- If any of the provided Permissions isnull
- See Also:
EnumSet
,Permission.getRaw(Collection)
-
-