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>
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor | Description |
---|---|
RoleAction(net.dv8tion.jda.core.requests.Route.CompiledRoute route,
Guild guild) |
Creates a new RoleAction instance
|
Modifier and Type | Method | Description |
---|---|---|
RoleAction |
setCheck(java.util.function.BooleanSupplier checks) |
Sets the last-second checks before finally executing the http request in the queue.
|
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.lang.Long permissions) |
Sets the Permissions the new Role should have.
|
RoleAction |
setPermissions(java.util.Collection<Permission> permissions) |
Sets the Permissions the new Role should have.
|
RoleAction |
setPermissions(Permission... permissions) |
Sets the Permissions the new Role should have.
|
reason
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
complete, complete, completeAfter, getJDA, isPassContext, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfter
public RoleAction setCheck(java.util.function.BooleanSupplier checks)
RestAction
false
or throws an exception this will not be finished.
When an exception is thrown from the supplier it will be provided to the failure callback.setCheck
in class AuditableRestAction<Role>
checks
- The checks to run before executing the request, or null
to run no checks@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
Permission.getRaw(Permission...)
@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
Permission.getRaw(Collection)
,
EnumSet
@CheckReturnValue public RoleAction setPermissions(java.lang.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...)