mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
check if a guildchannel is deletable (#1143)
* Update GuildChannel.js * eghhh * Update GuildChannel.js
This commit is contained in:
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user