Skip to content

Commit

Permalink
fix(joinVoiceChannel): skip permission check if Member uncached (#1383)
Browse files Browse the repository at this point in the history
Co-authored-by: Donovan Daniels <[email protected]>
  • Loading branch information
abalabahaha and DonovanDMC authored Jun 5, 2022
1 parent a2e3a00 commit 162d4ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2988,7 +2988,7 @@ class Client extends EventEmitter {
if(!channel) {
return Promise.reject(new Error("Channel not found"));
}
if(channel.guild && !(channel.permissionsOf(this.user.id).allow & Constants.Permissions.voiceConnect)) {
if(channel.guild && channel.guild.members.has(this.user.id) && !(channel.permissionsOf(this.user.id).allow & Constants.Permissions.voiceConnect)) {
return Promise.reject(new Error("Insufficient permission to connect to voice channel"));
}
this.shards.get(this.guildShardMap[this.channelGuildMap[channelID]] || 0).sendWS(Constants.GatewayOPCodes.VOICE_STATE_UPDATE, {
Expand Down

0 comments on commit 162d4ef

Please sign in to comment.