krisppurg / dimscord

A Discord Bot & REST Library for Nim.
https://krisppurg.github.io/dimscord/
MIT License
222 stars 22 forks source link

Fixes editGuildRolePosition #93

Closed filvyb closed 1 year ago

filvyb commented 1 year ago

Fixes API request in proc editGuildRolePosition to contain a JSON array with an object inside instead of a sole object thus making the request valid.

krisppurg commented 1 year ago

https://discord.com/developers/docs/resources/guild#modify-guild-role-positions I think you should just do smth like seq[tuple[role_id: string, position: Option[int]]] and the payload would be a json array of that since from docs it would be reasonable to assume you could modify multiple role positions at same time as it says it takes a json array

filvyb commented 1 year ago

I think this is simpler if you want the procedure to only edit a position of a single role. It would probably make sense though to rename the procedure to editGuildRolePositions and have it accept a sequence of tuples as an argument.