mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix: setPosition taking wrong IDs and edit with position 0 breaking (#1989)
* Fix typo in setPosition * Same typo in Role * Fix edit with position breaking when the position was 0 * Eslint * Revert code but fix the position issue
This commit is contained in:
@@ -280,7 +280,7 @@ class GuildChannel extends Channel {
|
||||
data: {
|
||||
name: (data.name || this.name).trim(),
|
||||
topic: data.topic,
|
||||
position: data.position || this.rawPosition,
|
||||
position: typeof data.position === 'number' ? data.position : this.rawPosition,
|
||||
bitrate: data.bitrate || (this.bitrate ? this.bitrate * 1000 : undefined),
|
||||
user_limit: data.userLimit != null ? data.userLimit : this.userLimit, // eslint-disable-line eqeqeq
|
||||
parent_id: data.parentID,
|
||||
@@ -357,7 +357,7 @@ class GuildChannel extends Channel {
|
||||
this.guild._sortedChannels(this), this.client.api.guilds(this.guild.id).channels, reason)
|
||||
.then(updatedChannels => {
|
||||
this.client.actions.GuildChannelsPositionUpdate.handle({
|
||||
guild_id: this.id,
|
||||
guild_id: this.guild.id,
|
||||
channels: updatedChannels,
|
||||
});
|
||||
return this;
|
||||
|
||||
@@ -279,7 +279,7 @@ class Role extends Base {
|
||||
this.guild._sortedRoles(), this.client.api.guilds(this.guild.id).roles, reason)
|
||||
.then(updatedRoles => {
|
||||
this.client.actions.GuildRolesPositionUpdate.handle({
|
||||
guild_id: this.id,
|
||||
guild_id: this.guild.id,
|
||||
channels: updatedRoles,
|
||||
});
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user