Skip to content

Commit

Permalink
✨ Enhanced role movement logic in MoveRole effect to support addition…
Browse files Browse the repository at this point in the history
…al move types
  • Loading branch information
Sky committed Feb 6, 2025
1 parent 15921aa commit 97d23f9
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ public void execute(@NotNull Event e) {
DiSky.debug("Moving role " + role.getName() + " above " + target.getName());

RoleOrderAction action = target.getGuild().modifyRolePositions();

switch (moveType) {
case ABOVE, UNDER -> action.selectPosition(role);
case UP, DOWN -> action.selectPosition(target);
}

action = switch (moveType) {
case ABOVE -> action.moveAbove(role);
case UNDER -> action.moveBelow(role);
Expand Down

0 comments on commit 97d23f9

Please sign in to comment.