public class RoleAction extends AuditableRestAction<Role>
RestAction
specifically
designed to create a Role
.
This extension allows setting properties before executing the action.AuditableRestAction.EmptyRestAction<T>, AuditableRestAction.FailedRestAction<T>
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor and Description |
---|
RoleAction(net.dv8tion.jda.core.requests.Route.CompiledRoute route,
Guild guild)
Creates a new RoleAction instance
|
Modifier and Type | Method and Description |
---|---|
RoleAction |
setColor(java.awt.Color color)
Sets the color which the new role should be displayed with.
|
RoleAction |
setColor(java.lang.Integer rgb)
Sets the Color for the new role.
|
RoleAction |
setHoisted(java.lang.Boolean hoisted)
Sets whether or not the new role should be hoisted
|
RoleAction |
setMentionable(java.lang.Boolean mentionable)
Sets whether the new role should be mentionable by members of
the parent
Guild . |
RoleAction |
setName(java.lang.String name)
Sets the name for new role (optional)
|
RoleAction |
setPermissions(java.util.Collection<Permission> permissions)
Sets the Permissions the new Role should have.
|
RoleAction |
setPermissions(long permissions)
Sets the Permissions the new Role should have.
|
RoleAction |
setPermissions(Permission... permissions)
Sets the Permissions the new Role should have.
|
reason
complete, complete, completeAfter, getJDA, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter
@CheckReturnValue public RoleAction setName(java.lang.String name)
name
- The name for the new role, null to use default name@CheckReturnValue public RoleAction setHoisted(java.lang.Boolean hoisted)
hoisted
- Whether the new role should be hoisted (grouped). Default is false
@CheckReturnValue public RoleAction setMentionable(java.lang.Boolean mentionable)
Guild
.mentionable
- Whether the new role should be mentionable. Default is false
@CheckReturnValue public RoleAction setColor(java.awt.Color color)
color
- An Color
for the new role, null to use default white/black@CheckReturnValue public RoleAction setColor(java.lang.Integer rgb)
0x000
to 0xFFFFFF
.
The provided value will be ranged using rbg & 0xFFFFFF
rgb
- The color for the new role in integer form, null
to use default white/black@CheckReturnValue public RoleAction setPermissions(Permission... permissions)
admin
of the parent Guild
.permissions
- The varargs Permissions
for the new roleInsufficientPermissionException
- If the currently logged in account does not hold one of the specified permissionsjava.lang.IllegalArgumentException
- If any of the provided permissions is null
@CheckReturnValue public RoleAction setPermissions(java.util.Collection<Permission> permissions)
admin
of the parent Guild
.permissions
- A Collection
of Permissions
for the new roleInsufficientPermissionException
- If the currently logged in account does not hold one of the specified permissionsjava.lang.IllegalArgumentException
- If any of the provided permissions is null
@CheckReturnValue public RoleAction setPermissions(long permissions)
admin
of the parent Guild
.permissions
- The raw Permissions
value for the new role.
To retrieve this use Permission.getRawValue()
java.lang.IllegalArgumentException
- If the provided permission value is invalidInsufficientPermissionException
- If the currently logged in account does not hold one of the specified permissionsPermission.getRawValue()
,
Permission.getRaw(java.util.Collection)
,
Permission.getRaw(net.dv8tion.jda.core.Permission...)