mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(VoiceChannel): deletable erroneously returning true
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const GuildChannel = require('./GuildChannel');
|
||||
const Collection = require('../util/Collection');
|
||||
const Permissions = require('../util/Permissions');
|
||||
|
||||
/**
|
||||
* Represents a guild voice channel on Discord.
|
||||
@@ -54,6 +55,15 @@ class VoiceChannel extends GuildChannel {
|
||||
return this.userLimit > 0 && this.members.size >= this.userLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the channel is deletable by the client user
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
get deletable() {
|
||||
return super.deletable && this.permissionsFor(this.client.user).has(Permissions.FLAGS.CONNECT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the client has permission join the voice channel
|
||||
* @type {boolean}
|
||||
|
||||
Reference in New Issue
Block a user