diff --git a/src/structures/GuildEmoji.js b/src/structures/GuildEmoji.js index c976eb78..95d970e0 100644 --- a/src/structures/GuildEmoji.js +++ b/src/structures/GuildEmoji.js @@ -1,4 +1,5 @@ const GuildEmojiRoleStore = require('../stores/GuildEmojiRoleStore'); +const Permissions = require('../util/Permissions'); const Snowflake = require('../util/Snowflake'); const Emoji = require('./Emoji'); @@ -44,9 +45,20 @@ class GuildEmoji extends Emoji { return clone; } + /** + * Whether the emoji is deletable by the client user + * @type {boolean} + * @readonly + */ + get deletable() { + return !this.managed && + this.channel.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_EMOJIS); + } + /** * A collection of roles this emoji is active for (empty if all), mapped by role ID * @type {GuildEmojiRoleStore} + * @readonly */ get roles() { return new GuildEmojiRoleStore(this);