mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 13:33:30 +01:00
fix(GuildChannel): Fix manageable method for voice-channels (#6447)
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com> Co-authored-by: Kyra <kyranet@users.noreply.github.com> Co-authored-by: ckohen <chaikohen@gmail.com>
This commit is contained in:
@@ -511,14 +511,12 @@ class GuildChannel extends Channel {
|
|||||||
*/
|
*/
|
||||||
get manageable() {
|
get manageable() {
|
||||||
if (this.client.user.id === this.guild.ownerId) return true;
|
if (this.client.user.id === this.guild.ownerId) return true;
|
||||||
if (VoiceBasedChannelTypes.includes(this.type)) {
|
const permissions = this.permissionsFor(this.client.user);
|
||||||
if (!this.permissionsFor(this.client.user).has(Permissions.FLAGS.CONNECT, false)) {
|
if (!permissions) return false;
|
||||||
return false;
|
const bitfield = VoiceBasedChannelTypes.includes(this.type)
|
||||||
}
|
? Permissions.FLAGS.MANAGE_CHANNELS | Permissions.FLAGS.CONNECT
|
||||||
} else if (!this.viewable) {
|
: Permissions.FLAGS.VIEW_CHANNEL | Permissions.FLAGS.MANAGE_CHANNELS;
|
||||||
return false;
|
return permissions.has(bitfield, false);
|
||||||
}
|
|
||||||
return this.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_CHANNELS, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user