mirror of
https://github.com/danbulant/discord.js
synced 2026-05-31 13:21:56 +00:00
fix(VoiceChannel): deletable erroneously returning true
This commit is contained in:
parent
46b19bbbdb
commit
0be0d2542d
1 changed files with 10 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
const GuildChannel = require('./GuildChannel');
|
||||
const Collection = require('../util/Collection');
|
||||
const { browser } = require('../util/Constants');
|
||||
const Permissions = require('../util/Permissions');
|
||||
const { Error } = require('../errors');
|
||||
|
||||
/**
|
||||
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Reference in a new issue