public interface Role extends ISnowflake, IMentionable, java.lang.Comparable<Role>
Modifier and Type | Method and Description |
---|---|
boolean |
canInteract(Role role) |
RestAction<java.lang.Void> |
delete() |
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()
Returns the
RoleManager for this Role. |
RoleManagerUpdatable |
getManagerUpdatable() |
java.lang.String |
getName()
The Name of the
Role . |
java.util.List<Permission> |
getPermissions()
A list of the literal
Permissions that this Role has.NOTE: these do not necessarily represent the permissions this role will have in a Channel . |
long |
getPermissionsRaw()
|
int |
getPosition()
|
int |
getPositionRaw()
The actual position of the
Role as stored and given by Discord. |
boolean |
hasPermission(Channel channel,
java.util.Collection<Permission> permissions)
Checks if this
Role has access to the Permissions
in the provided Collection<Permission> in the specified Channel . |
boolean |
hasPermission(Channel chanel,
Permission... permissions)
|
boolean |
hasPermission(java.util.Collection<Permission> permissions)
Checks if this
Role has access to the Permissions
in the provided Collection<Permission>This does not check the Channel-specific override Permissions . |
boolean |
hasPermission(Permission... permissions)
Checks if this
Role has access to the provided Permissions . |
boolean |
isHoisted()
Is this
Role hoisted?Members in a hoisted role are displayed in their own grouping on the user-list |
boolean |
isManaged()
Is this
Role managed?(Via plugins like Twitch). |
boolean |
isMentionable()
Returns wheter or not this Role is mentionable
|
getCreationTime, getId
getAsMention
int getPosition()
Role
in the Guild
hierarchy.Role
always return -1.Role
as integer.int getPositionRaw()
Role
as stored and given by Discord.
Role positions are actually based on a pairing of the creation time (as stored in the snowflake id)
and the position. If 2 or more roles share the same position then they are sorted based on their creation date.
The more recent a role was created, the lower it is in the heirarchy. This is handled by 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
managed?Role
is managed.boolean isHoisted()
Role
hoisted?Role
is hoisted.boolean isMentionable()
long getPermissionsRaw()
long
representation of the literal permissions that this Role
has.Channel
.java.util.List<Permission> getPermissions()
Permissions
that this Role
has.Channel
.java.awt.Color getColor()
Role
is displayed in.boolean hasPermission(Permission... permissions)
Role
has access to the provided Permissions
.
This does not check the Channel-specific override Permissions
.
NOTE: this is not the same as getPermissions()
.contains(Permission)
as it does effective permission calculations. The correct usage of this method is to determine if a Role has
the ability to do something.
permissions
- The Permissions
to check forPermissions
are available to this Role
boolean hasPermission(java.util.Collection<Permission> permissions)
Role
has access to the Permissions
in the provided Collection<Permission>Permissions
.
NOTE: this is not the same as getPermissions()
.contains(Permission)
as it does effective permission calculations. The correct usage of this method is to determine if a Role has
the ability to do something.
permissions
- The Permissions
to check forPermissions
are available to this Role
boolean hasPermission(Channel chanel, Permission... permissions)
permissions
- The Permissions
to check forPermissions
are available to this Role
in this Channelboolean hasPermission(Channel channel, java.util.Collection<Permission> permissions)
Role
has access to the Permissions
in the provided Collection<Permission> in the specified Channel
.permissions
- The Permissions
to check forPermissions
are available to this Role
in this Channelboolean canInteract(Role role)
Guild getGuild()
Guild
this Role exists inRoleManager getManager()
RoleManager
for this Role.
In the RoleManager, you can modify all its values.RoleManagerUpdatable getManagerUpdatable()
RestAction<java.lang.Void> delete()