editChannelPosition(channelID, position) {
        let channels = this.guilds.get(this.channelGuildMap[channelID]).channels;
        const channel = channels.get(channelID);
        if(!channel) {
            return Promise.reject(new Error(`Channel ${channelID} not found`));
        }
        if(channel.position === position) {
            return Promise.resolve();
        }
        const min = Math.min(position, channel.position);
        const max = Math.max(position, channel.position);
        channels = channels.filter((chan) => chan.type === channel.type && chan.parentID === channel.parentID && min <= chan.position && chan.position <= max && chan.id !== channelID).sort((a, b) => a.position - b.position);
        if(position > channel.position) {
            channels.push(channel);
        } else {
            channels.unshift(channel);
        }
        return this.requestHandler.request("PATCH", Endpoints.GUILD_CHANNELS(this.channelGuildMap[channelID]), true, channels.map((channel, index) => ({
            id: channel.id,
            position: index + min
        })));
    }
/**
    * Edit a guild channel's position. Note that channel position numbers are lowest on top and highest at the bottom.
    * @arg {String} channelID The ID of the channel
    * @arg {Number} position The new position of the channel
    * @returns {Promise}
    */
Edit a guild channel's position. Note that channel position numbers are lowest on top and highest at the bottom.
@arg {String} channelID The ID of the channel
@arg {Number} position The new position of the channel
@returns {Promise}
Edit a guild channel ' s position . Note that channel position numbers are lowest on top and highest at the bottom . @arg { String } channelID The ID of the channel @arg { Number } position The new position of the channel @returns { Promise }
editChannelPosition(channelID, position) {
        let channels = this.guilds.get(this.channelGuildMap[channelID]).channels;
        const channel = channels.get(channelID);
        if(!channel) {
            return Promise.reject(new Error(`Channel ${channelID} not found`));
        }
        if(channel.position === position) {
            return Promise.resolve();
        }
        const min = Math.min(position, channel.position);
        const max = Math.max(position, channel.position);
        channels = channels.filter((chan) => chan.type === channel.type && chan.parentID === channel.parentID && min <= chan.position && chan.position <= max && chan.id !== channelID).sort((a, b) => a.position - b.position);
        if(position > channel.position) {
            channels.push(channel);
        } else {
            channels.unshift(channel);
        }
        return this.requestHandler.request("PATCH", Endpoints.GUILD_CHANNELS(this.channelGuildMap[channelID]), true, channels.map((channel, index) => ({
            id: channel.id,
            position: index + min
        })));
    }
editChannelPosition ( channelID , position ) { let channels = this . guilds . get ( this . channelGuildMap [ channelID ] ) . channels ; const channel = channels . get ( channelID ) ; if ( ! channel ) { return Promise . reject ( new Error ( ` ${ channelID } ` ) ) ; } if ( channel . position === position ) { return Promise . resolve ( ) ; } const min = Math . min ( position , channel . position ) ; const max = Math . max ( position , channel . position ) ; channels = channels . filter ( ( chan ) => chan . type === channel . type && chan . parentID === channel . parentID && min <= chan . position && chan . position <= max && chan . id !== channelID ) . sort ( ( a , b ) => a . position - b . position ) ; if ( position > channel . position ) { channels . push ( channel ) ; } else { channels . unshift ( channel ) ; } return this . requestHandler . request ( "PATCH" , Endpoints . GUILD_CHANNELS ( this . channelGuildMap [ channelID ] ) , true , channels . map ( ( channel , index ) => ( { id : channel . id , position : index + min } ) ) ) ; }
Edit a guild channel's position.
Edit a guild channel ' s position .