public interface Role extends ISnowflake, IMentionable, IPermissionHolder, java.lang.Comparable<Role>
Guild's Role. Used to control permissions for Members.| Modifier and Type | Method and Description |
|---|---|
boolean |
canInteract(Role role)
Whether this Role can interact with the specified Role.
|
AuditableRestAction<java.lang.Void> |
delete()
Deletes this Role.
|
java.awt.Color |
getColor()
The color this
Role is displayed in. |
Guild |
getGuild()
Returns the
Guild this Role exists in |
JDA |
getJDA()
Returns the
JDA instance of this Role |
RoleManager |
getManager()
The
RoleManager for this Role. |
RoleManagerUpdatable |
getManagerUpdatable()
The
RoleManagerUpdatable for this Role. |
java.lang.String |
getName()
The Name of this
Role. |
long |
getPermissionsRaw()
The
long representation of the literal permissions that this Role has. |
int |
getPosition()
|
int |
getPositionRaw()
The actual position of the
Role as stored and given by Discord. |
boolean |
isHoisted()
Whether this
Role is hoisted
Members in a hoisted role are displayed in their own grouping on the user-list |
boolean |
isManaged()
Whether this
Role is managed by an integration |
boolean |
isMentionable()
Whether or not this Role is mentionable
|
boolean |
isPublicRole()
|
getCreationTime, getId, getIdLongformatTo, getAsMentiongetPermissions, hasPermission, hasPermission, hasPermission, hasPermissionint getPosition()
Role
in the Guild hierarchy. (higher value means higher role).
Guild.getPublicRole()'s getPosition() always return -1.Role as integer.int getPositionRaw()
Role as stored and given by Discord.
getPosition()
and it is most likely the method you want. If, for some reason, you want the actual position of the
Role then this method will give you that value.Role.java.lang.String getName()
Role.Role.boolean isManaged()
Role is managed by an integrationRole is managed.boolean isHoisted()
Role is hoisted
Role is hoisted.boolean isMentionable()
long getPermissionsRaw()
long representation of the literal permissions that this Role has.
Channel.java.awt.Color getColor()
Role is displayed in.boolean isPublicRole()
Guild,
which is assigned to everyone who joins the Guild.Role is the public role
for the Guild provided by getGuild().Guild.getPublicRole()boolean canInteract(Role role)
role - The not-null role to compare tojava.lang.IllegalArgumentException - if the provided Role is null or not from the same GuildPermissionUtil.canInteract(Role, Role)Guild getGuild()
Guild this Role exists ingetGuild in interface IPermissionHolderRoleManager getManager()
RoleManager for this Role.
In the RoleManager, you can modify all its values.RoleManagerUpdatable getManagerUpdatable()
RoleManagerUpdatable for this Role.
In the Manager, you can modify all its values.
This can be used to bulk update role properties.
It requires to call an update() method.
RoleManagerUpdatable for this Role@CheckReturnValue AuditableRestAction<java.lang.Void> delete()
Possible ErrorResponses include:
ErrorResponse.UNKNOWN_ROLE
MISSING_PERMISSIONS
Permission.MANAGE_ROLES in the channel.MISSING_ACCESS
RestActionInsufficientPermissionException - If we don't have the permission to MANAGE_ROLESHierarchyException - If the role is too high in the role hierarchy to be deleted