fix: adapt #manageable to check for CONNECT for VoiceChannel (#3885)

This commit is contained in:
Souji
2020-03-06 07:00:49 +01:00
committed by GitHub
parent 0066d0089e
commit 61ef46ff30

View File

@@ -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);
}