public interface Role extends ISnowflake, IMentionable, java.lang.Comparable<Role>
Modifier and Type | Method and Description |
---|---|
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 |
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 . |
java.util.List<Permission> |
getPermissions(Channel channel) |
int |
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 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 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 the provided Permissions .This does not check the Channel-specific override 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()
int getPermissionsRaw()
int
representation of the literal permissions that this Role
has.Channel
.java.util.List<Permission> getPermissions()
Permissions
that this Role
has.Channel
.java.util.List<Permission> getPermissions(Channel channel)
java.awt.Color getColor()
Role
is displayed in.boolean hasPermission(Permission... permissions)
Role
has the provided Permissions
.Permissions
.permissions
- The Permissions
to check forPermissions
are available to this Role
boolean hasPermission(java.util.Collection<Permission> permissions)
Role
has the Permissions
in the provided Collection<Permission>Permissions
.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 the Permissions
in the provided Collection<Permission> in the specified Channel
.permissions
- The Permissions
to check forPermissions
are available to this Role
in this ChannelGuild getGuild()
Guild
this Role exists in