Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(GuildChannel): Fix manageable method for voice-channels #6447

Merged
merged 5 commits into from Aug 29, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/structures/GuildChannel.js
Expand Up @@ -511,14 +511,13 @@ class GuildChannel extends Channel {
*/
get manageable() {
if (this.client.user.id === this.guild.ownerId) return true;
if (VoiceBasedChannelTypes.includes(this.type)) {
if (!this.permissionsFor(this.client.user).has(Permissions.FLAGS.CONNECT, false)) {
return false;
}
} else if (!this.viewable) {
if (!this.viewable) return false;
const permissions = this.permissionsFor(this.client.user);
if (!permissions) return false;
if (VoiceBasedChannelTypes.includes(this.type) && !permissions.has(Permissions.FLAGS.CONNECT, false)) {
DraftProducts marked this conversation as resolved.
Show resolved Hide resolved
return false;
}
return this.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_CHANNELS, false);
return permissions.has(Permissions.FLAGS.MANAGE_CHANNELS, false);
}

/**
Expand Down