-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Implement 'Modify Guild Channel Positions' #1198
Conversation
This is a great PR but you mixed it with a meme... please separate the meme and the real PR thank you. 🙇 |
Removed shuffleChannels method from the Guild object and replaced with a regular 'updateChannels' method. Also removed the shuffleArray utility method since it would be unused. |
shouldn't the method be named |
also |
I'll make those changes asap when I get home, thank you! |
Updated 'channelId' to 'channelID', I was also using 'guildId' instead of 'guildID' in RESTMethods so I updated that as well. |
src/structures/Guild.js
Outdated
|
||
/** | ||
* Updates this guild's channel positions as a batch. | ||
* @param {Object[]} newChannelPositions Array of objects with an id and a position. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A typedef is needed, rather than Object
.
Should I do two typedefs, one for the array and one for the object inside? |
No, just one for the object. |
I updated the doc, please let me know if it needs more changes -- haven't worked with this style of documentation before. Thanks! |
Looks good! 👍 |
* Adding shuffleArray method to utils * Shuffle channels functionality on guild. * Comment fix * Removing shuffle functionality and replacing with a simple update * Code review changes to method/variable names * Update comment reference to channelId as well * Updating jsdoc with typedef of ChannelPosition
* Adding shuffleArray method to utils * Shuffle channels functionality on guild. * Comment fix * Removing shuffle functionality and replacing with a simple update * Code review changes to method/variable names * Update comment reference to channelId as well * Updating jsdoc with typedef of ChannelPosition
Currently the library implements the 'Create Channels' endpoint via POST to /guilds/{guild.id}/channels, but doesn't implement the 'Modify Guild Channel Positions' endpoint at all.
This change adds that support as well as a method on Guild which will shuffle all existing channels using a new utility method for shuffling arrays.