From 3ad16fa351cc6a806cd88f1839569b54198664af Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Sat, 18 May 2019 14:08:12 +0200 Subject: [PATCH] fix(GuildMember): do not create a channel key when editing This is to not break GuildMember#setNickname for the current user --- src/structures/GuildMember.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index 697f8e061..bc2d01e66 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -271,10 +271,11 @@ class GuildMember extends Base { throw new Error('GUILD_VOICE_CHANNEL_RESOLVE'); } data.channel_id = data.channel.id; + data.channel = undefined; } else if (data.channel === null) { data.channel_id = null; + data.channel = undefined; } - data.channel = undefined; if (data.roles) data.roles = data.roles.map(role => role instanceof Role ? role.id : role); let endpoint = this.client.api.guilds(this.guild.id); if (this.user.id === this.client.user.id) {