JDA
JDA copied to clipboard
Add category feature to ChannelOrderAction
Pull Request Etiquette
- [x] I have checked the PRs for upcoming features/bug fixes.
- [x] I have read the contributing guidelines.
Changes
- [ ] Internal code
- [x] Library interface (affecting end-user code)
- [ ] Documentation
- [ ] Other: _____
Closes Issue: NaN
Description
Adds support for lock_permissions, parent_id, and new move operations moveAbove and moveBelow.
~~Note: moveAbove will actually behave unexpectedly for modifyRolePositions because it uses the reverse order by default. Using guild.modifyRolePositions().selectPosition(b).moveAbove(a) will actually move it below a in the role list.~~
Breaking Change
The order of Guild#modifyRolePositions is now descending by default. This better aligns with all other role orders used in JDA, such as Member#getRoles and Guild#getRoles, which are both descending as well. In addition, this also makes more sense for moveAbove and moveBelow.
Example
var category = guild.getCategoryById(936772770262552626);
var marker = guild.getTextChannelById(936772801807933480);
guild.createTextChannel("test-b").queue(it -> {
guild.modifyTextChannelPositions()
.selectPosition(it)
.setCategory(category, true)
.moveAbove(marker)
.queue();
});