mirror of
https://github.com/danbulant/discord.js
synced 2026-06-15 12:41:24 +00:00
check if a guildchannel is deletable (#1143)
* Update GuildChannel.js * eghhh * Update GuildChannel.js
This commit is contained in:
parent
c7f5b44e03
commit
2beb77ab5c
1 changed files with 10 additions and 0 deletions
|
|
@ -281,6 +281,16 @@ class GuildChannel extends Channel {
|
|||
return equal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the channel is deletable by the client user.
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
get deletable() {
|
||||
return this.id !== this.guild.id &&
|
||||
this.permissionsFor(this.client.user).hasPermission(Constants.PermissionFlags.MANAGE_CHANNELS);
|
||||
}
|
||||
|
||||
/**
|
||||
* When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.
|
||||
* @returns {string}
|
||||
|
|
|
|||
Loading…
Reference in a new issue