Skip to content

Commit

Permalink
fix voiceState patching
Browse files Browse the repository at this point in the history
timotejroiko committed Jul 11, 2020
1 parent 4edf9b3 commit 6b1b74b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion discord.js
Original file line number Diff line number Diff line change
@@ -586,10 +586,17 @@ Discord.RoleManager.prototype.fetch = async function(id, cache) {
}

Discord.VoiceState.prototype._patch = function(data) {
Object.getPrototypeOf(this.constructor.prototype)._patch.call(this, data);
this.serverDeaf = data.deaf;
this.serverMute = data.mute;
this.selfDeaf = data.self_deaf;
this.selfMute = data.self_mute;
this.sessionID = data.session_id;
this.streaming = data.self_stream || false;
this.channelID = data.channel_id;
if(data.member && data.member.user && !this.guild.members.cache.has(data.member.user.id)) {
this._member = data.member;
}
return this;
}

Object.defineProperty(Discord.VoiceState.prototype, "channel", {

0 comments on commit 6b1b74b

Please sign in to comment.