DiSkyOrg / DiSky

The best Skript add-on for Discord management! Slash commands, interaction, components, modal and much more available!
https://disky.me/
Apache License 2.0
42 stars 12 forks source link

Changing the order of channels/channel position #187

Closed theOneSchrill closed 3 months ago

theOneSchrill commented 3 months ago

A syntax to make channels change their position would be cool

A syntax to change channels order I want to change one channels position, the other channels shall move accordingly, pretty much just the same process as when u do it manually in your discord servers settings.

'set channel position of event-channel to (channel position of event-channel)+1' no

ItsTheSky commented 3 months ago

Are you talking about this expression? You can modify it, have you tried it yet?

theOneSchrill commented 3 months ago

Yea I've tried it with that expression but when I used set channel position of event-channel to (channel position of event-channel)+1 it didnt change the position of the channel (same with -1)

ItsTheSky commented 3 months ago

Hi there! After some tests, It seems a lot of weird things are happening with the syntax. Can you try using the possession pattern? For instance:

set <channel>'s channel position to {_pos}
theOneSchrill commented 3 months ago

Hey! So after trying this, it seems like some channels are moving only and they're moving a little weird. The channel which I selected was at position 1 (of a total of 3 channels). The channel got moved to position 3 instead of 2. After that, I couldn't move it back up with my up button Code: https://justpaste.it/fb3hp the bot successfully replies with up and down, depending what button I click on.

ItsTheSky commented 3 months ago

Yup, the whole logic I did behind was broken (cuz math wasn't mathing). Although it got fixed, it seems positioning two channels at the same position will make them re-arrange in another way (sorted by creation date). I'll close this issue as I got it working fine on my end with v4.16.0 that's coming soon. Feel free to open a new one if the problem persists!