public class RoleManager
extends net.dv8tion.jda.core.managers.impl.ManagerBase
Role
.
Example
manager.setName("Administrator")
.setColor(null)
.queue();
manager.reset(RoleManager.PERMISSION | RoleManager.NAME)
.setName("Traitor")
.setColor(Color.RED)
.queue();
Role.getManager()
AuditableRestAction.EmptyRestAction<T>
Modifier and Type | Field | Description |
---|---|---|
static long |
COLOR |
Used to reset the color field
|
static long |
HOIST |
Used to reset the hoisted field
|
static long |
MENTIONABLE |
Used to reset the mentionable field
|
static long |
NAME |
Used to reset the name field
|
static long |
PERMISSION |
Used to reset the permission field
|
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor | Description |
---|---|
RoleManager(Role role) |
Creates a new RoleManager instance
|
Modifier and Type | Method | Description |
---|---|---|
Guild |
getGuild() |
|
Role |
getRole() |
The target
Role for this
manager |
RoleManager |
givePermissions(java.util.Collection<Permission> perms) |
Adds the specified
Permissions to the selected Role . |
RoleManager |
givePermissions(Permission... perms) |
Adds the specified
Permissions to the selected Role . |
RoleManager |
reset() |
Resets all fields for this manager.
|
RoleManager |
reset(long fields) |
Resets the fields specified by the provided bit-flag pattern.
|
RoleManager |
reset(long... fields) |
Resets the fields specified by the provided bit-flag patterns.
|
RoleManager |
revokePermissions(java.util.Collection<Permission> perms) |
Revokes the specified
Permissions from the selected Role . |
RoleManager |
revokePermissions(Permission... perms) |
Revokes the specified
Permissions from the selected Role . |
RoleManager |
setColor(int rgb) |
Sets the rgb color of the selected
Role . |
RoleManager |
setColor(java.awt.Color color) |
Sets the
Color of the selected Role . |
RoleManager |
setHoisted(boolean hoisted) |
Sets the hoist state of the selected
Role . |
RoleManager |
setMentionable(boolean mentionable) |
Sets the mentionable state of the selected
Role . |
RoleManager |
setName(java.lang.String name) |
Sets the name of the selected
Role . |
RoleManager |
setPermissions(long perms) |
Sets the
Permissions of the selected Role . |
RoleManager |
setPermissions(java.util.Collection<Permission> permissions) |
Sets the
Permissions of the selected Role . |
RoleManager |
setPermissions(Permission... permissions) |
Sets the
Permissions of the selected Role . |
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 NAME
public static final long COLOR
public static final long PERMISSION
public static final long HOIST
public static final long MENTIONABLE
@CheckReturnValue public RoleManager reset(long fields)
manager.reset(RoleManager.COLOR | RoleManager.NAME);
Flag Constants:
reset
in class net.dv8tion.jda.core.managers.impl.ManagerBase
fields
- Integer value containing the flags to reset.@CheckReturnValue public RoleManager reset(long... fields)
manager.reset(RoleManager.COLOR, RoleManager.NAME);
Flag Constants:
reset
in class net.dv8tion.jda.core.managers.impl.ManagerBase
fields
- Integer values containing the flags to reset.@CheckReturnValue public RoleManager reset()
@CheckReturnValue public RoleManager setName(java.lang.String name)
Role
.
A role name must not be null
nor less than 1 characters or more than 32 characters long!
name
- The new name for the selected Role
java.lang.IllegalArgumentException
- If the provided name is null
or not between 1-32 characters long@CheckReturnValue public RoleManager setPermissions(long perms)
Permissions
of the selected Role
.
Permissions may only include already present Permissions for the currently logged in account.
You are unable to give permissions you don't have!
perms
- The new raw permission value for the selected Role
InsufficientPermissionException
- If the currently logged in account does not have permission to apply one of the specified permissionssetPermissions(Collection)
,
setPermissions(Permission...)
@CheckReturnValue public RoleManager setPermissions(Permission... permissions)
Permissions
of the selected Role
.
Permissions may only include already present Permissions for the currently logged in account.
You are unable to give permissions you don't have!
permissions
- The new permission for the selected Role
InsufficientPermissionException
- If the currently logged in account does not have permission to apply one of the specified permissionsjava.lang.IllegalArgumentException
- If any of the provided values is null
setPermissions(Collection)
,
setPermissions(long)
,
Permission.getRaw(Permission...)
@CheckReturnValue public RoleManager setPermissions(java.util.Collection<Permission> permissions)
Permissions
of the selected Role
.
Permissions may only include already present Permissions for the currently logged in account.
You are unable to give permissions you don't have!
permissions
- The new permission for the selected Role
InsufficientPermissionException
- If the currently logged in account does not have permission to apply one of the specified permissionsjava.lang.IllegalArgumentException
- If any of the provided values is null
setPermissions(Permission...)
,
setPermissions(long)
,
EnumSet
,
Permission.getRaw(Collection)
@CheckReturnValue public RoleManager setColor(java.awt.Color color)
Color
of the selected Role
.color
- The new color for the selected Role
@CheckReturnValue public RoleManager setColor(int rgb)
Role
.rgb
- The new color for the selected Role
Role.DEFAULT_COLOR_RAW
@CheckReturnValue public RoleManager setHoisted(boolean hoisted)
Role
.hoisted
- Whether the selected Role
should be hoisted@CheckReturnValue public RoleManager setMentionable(boolean mentionable)
Role
.mentionable
- Whether the selected Role
should be mentionable@CheckReturnValue public RoleManager givePermissions(Permission... perms)
Permissions
to the selected Role
.
Permissions may only include already present Permissions for the currently logged in account.
You are unable to give permissions you don't have!
perms
- The permission to give to the selected Role
InsufficientPermissionException
- If the currently logged in account does not have permission to apply one of the specified permissionssetPermissions(Collection)
,
setPermissions(Permission...)
,
Permission.getRaw(Permission...)
@CheckReturnValue public RoleManager givePermissions(java.util.Collection<Permission> perms)
Permissions
to the selected Role
.
Permissions may only include already present Permissions for the currently logged in account.
You are unable to give permissions you don't have!
perms
- The permission to give to the selected Role
InsufficientPermissionException
- If the currently logged in account does not have permission to apply one of the specified permissionssetPermissions(Collection)
,
setPermissions(Permission...)
,
EnumSet
,
Permission.getRaw(Collection)
@CheckReturnValue public RoleManager revokePermissions(Permission... perms)
Permissions
from the selected Role
.
Permissions may only include already present Permissions for the currently logged in account.
You are unable to revoke permissions you don't have!
perms
- The permission to give to the selected Role
InsufficientPermissionException
- If the currently logged in account does not have permission to revoke one of the specified permissionssetPermissions(Collection)
,
setPermissions(Permission...)
,
Permission.getRaw(Permission...)
@CheckReturnValue public RoleManager revokePermissions(java.util.Collection<Permission> perms)
Permissions
from the selected Role
.
Permissions may only include already present Permissions for the currently logged in account.
You are unable to revoke permissions you don't have!
perms
- The permission to give to the selected Role
InsufficientPermissionException
- If the currently logged in account does not have permission to revoke one of the specified permissionssetPermissions(Collection)
,
setPermissions(Permission...)
,
EnumSet
,
Permission.getRaw(Collection)