Skip to content

Commit

Permalink
fix: adapt #manageable to check for CONNECT for VoiceChannel (#3885)
Browse files Browse the repository at this point in the history
  • Loading branch information
almostSouji authored Mar 6, 2020
1 parent 0066d00 commit 61ef46f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/structures/GuildChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,13 @@ class GuildChannel extends Channel {
*/
get manageable() {
if (this.client.user.id === this.guild.ownerID) return true;
if (!this.viewable) return false;
if (this.type === 'voice') {
if (!this.permissionsFor(this.client.user).has(Permissions.FLAGS.CONNECT, false)) {
return false;
}
} else if (!this.viewable) {
return false;
}
return this.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_CHANNELS, false);
}

Expand Down

0 comments on commit 61ef46f

Please sign in to comment.