mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00: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:
parent
a22b856494
commit
fbd25f8677
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue