mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
Implement 'Modify Guild Channel Positions' (#1198)
* 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
This commit is contained in:
@@ -751,6 +751,15 @@ class RESTMethods {
|
||||
.then(() => user);
|
||||
}
|
||||
|
||||
updateChannelPositions(guildID, channels) {
|
||||
return this.rest.makeRequest('patch', Constants.Endpoints.guildChannels(guildID), true, channels).then(() =>
|
||||
this.client.actions.GuildChannelsPositionUpdate.handle({
|
||||
guild_id: guildID,
|
||||
channels,
|
||||
}).guild
|
||||
);
|
||||
}
|
||||
|
||||
setRolePositions(guildID, roles) {
|
||||
return this.rest.makeRequest('patch', Constants.Endpoints.guildRoles(guildID), true, roles).then(() =>
|
||||
this.client.actions.GuildRolesPositionUpdate.handle({
|
||||
|
||||
Reference in New Issue
Block a user