mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
Several improvements
- Rename Guild#updateChannelPositions -> setChannelPositions - Allow Guild#setChannelPositions to take ChannelResolvables - Prioritise ClientDataResolver#resolveChannel's string case - Minor cleanup
This commit is contained in:
@@ -639,20 +639,20 @@ class Guild {
|
||||
/**
|
||||
* The data needed for updating a channel's position.
|
||||
* @typedef {Object} ChannelPosition
|
||||
* @property {Snowflake} id The channel being updated's unique id.
|
||||
* @property {number} position The new position of the channel.
|
||||
* @property {ChannelResolvable} channel Channel to update
|
||||
* @property {number} position New position for the channel
|
||||
*/
|
||||
|
||||
/**
|
||||
* Updates this guild's channel positions as a batch.
|
||||
* @param {Array<ChannelPosition>} channelPositions Array of objects that defines which channel is going where.
|
||||
* Batch-updates the guild's channels' positions.
|
||||
* @param {ChannelPosition[]} channelPositions Channel positions to update
|
||||
* @returns {Promise<Guild>}
|
||||
* @example
|
||||
* guild.updateChannels([{ id: channelID, position: newChannelIndex }])
|
||||
* .then(guild => console.log(`Updated channels for ${guild.id}`))
|
||||
* guild.updateChannels([{ channel: channelID, position: newChannelIndex }])
|
||||
* .then(guild => console.log(`Updated channel positions for ${guild.id}`))
|
||||
* .catch(console.error);
|
||||
*/
|
||||
updateChannelPositions(channelPositions) {
|
||||
setChannelPositions(channelPositions) {
|
||||
return this.client.rest.methods.updateChannelPositions(this.id, channelPositions);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user