Class RoleOrderAction
- java.lang.Object
-
- net.dv8tion.jda.core.requests.RestAction<java.lang.Void>
-
- net.dv8tion.jda.core.requests.restaction.order.OrderAction<Role,RoleOrderAction>
-
- net.dv8tion.jda.core.requests.restaction.order.RoleOrderAction
-
public class RoleOrderAction extends OrderAction<Role,RoleOrderAction>
Implementation ofOrderAction
designed to modify the order ofRoles
of the specifiedGuild
.
To apply the changes you must finish theRestAction
Before you can use any of the
move
methods you must use eitherselectPosition(Role)
orOrderAction.selectPosition(int)
!This uses descending order!
- Since:
- 3.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.dv8tion.jda.core.requests.RestAction
RestAction.EmptyRestAction<T>
-
-
Field Summary
-
Fields inherited from class net.dv8tion.jda.core.requests.RestAction
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
-
-
Constructor Summary
Constructors Constructor Description RoleOrderAction(Guild guild, boolean useDiscordOrder)
Creates a new RoleOrderAction instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Guild
getGuild()
TheGuild
which holds the roles fromOrderAction.getCurrentOrder()
-
Methods inherited from class net.dv8tion.jda.core.requests.restaction.order.OrderAction
getCurrentOrder, getSelectedEntity, getSelectedPosition, moveDown, moveTo, moveUp, reverseOrder, selectPosition, selectPosition, setCheck, shuffleOrder, sortOrder, swapPosition, swapPosition
-
Methods inherited from class net.dv8tion.jda.core.requests.RestAction
complete, complete, completeAfter, getJDA, isPassContext, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfter
-
-
-
-
Constructor Detail
-
RoleOrderAction
public RoleOrderAction(Guild guild, boolean useDiscordOrder)
Creates a new RoleOrderAction instance- Parameters:
guild
- The targetGuild
of which to change theRole
orderuseDiscordOrder
- Defines the ordering of the OrderAction. Iftrue
, the OrderAction will be in the ordering defined by Discord for roles, which is Descending. This means that the highest role appears at index0
and the lowest role at indexn - 1
. Providingfalse
will result in the ordering being in ascending order, with the lower role at index0
and the highest at indexn - 1
.
As a note:Member.getRoles()
andGuild.getRoles()
are both in descending order.
-
-
Method Detail
-
getGuild
public Guild getGuild()
TheGuild
which holds the roles fromOrderAction.getCurrentOrder()
- Returns:
- The corresponding
Guild
-
-