mirror of
https://github.com/danbulant/discord.js
synced 2026-06-24 17:21:59 +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;
|
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.
|
* When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue