Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GuildChannel:move[Up|Down] don't always change the channel position as expected #253

Open
BestMordaEver opened this issue Aug 8, 2020 · 2 comments
Labels

Comments

@BestMordaEver
Copy link
Contributor

Steps to reproduce:

  1. Create a new guild, delete all default channels, invite your bot there
  2. Create a text channel, call it root1
  3. Create a category, in it create five text channels, call them cat1-5
  4. Create two more text channels without category, call them root2 and root3
  5. Using the bot, create a new text channel without category, call it root4, and move it to top using :moveUp(3). Notice that final channels order will be root1, root4, root2, root3

Expected behavior: final channels order is root4, root1, root2, root3

Possible reasoning behind this is that Discordia doesn't properly predict the final position indexes of channels. This is confirmed by checking the channel position after :moveUp(), then manually modifying its name and checking the channel position that is received via channelUpdate event - they will be different, which means there's a discrepancy.

@SinisterRectus
Copy link
Owner

Thanks for the report, I will investigate when I can.

@SinisterRectus
Copy link
Owner

I never took the time to try to reproduce this issue. I can say that 3.0 will almost certainly not have moveUp/moveDown methods due to complications with validating position values and permissions affected by the role hierarchy. Instead, there are currently Guild:sortRoles and Guild:sortChannels methods which both accept a mapping of id to position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants