mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
fix(GuildMember): make edit method only modify a copy of the voice state
This is to fix stale members in voice channels.
This commit is contained in:
@@ -357,7 +357,8 @@ class GuildMember extends Base {
|
||||
const clone = this._clone();
|
||||
data.user = this.user;
|
||||
clone._patch(data);
|
||||
clone._frozenVoiceState = this.voiceState;
|
||||
clone._frozenVoiceState = {};
|
||||
Object.assign(clone._frozenVoiceState, this.voiceState);
|
||||
if (typeof data.mute !== 'undefined') clone._frozenVoiceState.mute = data.mute;
|
||||
if (typeof data.deaf !== 'undefined') clone._frozenVoiceState.mute = data.deaf;
|
||||
if (typeof data.channel_id !== 'undefined') clone._frozenVoiceState.channel_id = data.channel_id;
|
||||
|
||||
Reference in New Issue
Block a user