Skip to content

How to move a channel to another category and sort this category by name #2435

Discussion options

You must be logged in to vote

This might work:

channel.getManager().setParent(cat).delay(500, TimeUnit.MILLISECONDS).queue(v -> {
  cat.modifyTextChannelPositions().sortOrder(Comparator.comparing(GuildChannel::getName)).queue();
});
  1. setParent(cat) moves the channel into the category
  2. delay(500, MILLISECONDS) makes the callback run half a second later (to avoid race conditions)
  3. sortOrder(Comparator.comparing(GuildChannel::getName)) sorts by name

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@deso85
Comment options

@MinnDevelopment
Comment options

Answer selected by deso85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants