mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
feat(Emoji): add deletable getter
Backport for commit: fca6d3be56
From PR: #2535
This commit is contained in:
parent
21326f67a0
commit
ed8ab91782
1 changed files with 10 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
const Constants = require('../util/Constants');
|
||||
const Collection = require('../util/Collection');
|
||||
const Permissions = require('../util/Permissions');
|
||||
const Snowflake = require('../util/Snowflake');
|
||||
|
||||
/**
|
||||
|
|
@ -76,6 +77,15 @@ class Emoji {
|
|||
return new Date(this.createdTimestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the moej is deletable by the client user
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
get deletable() {
|
||||
return !this.managed && this.guild.me.hasPermission(Permissions.FLAGS.MANAGE_EMOJIS);
|
||||
}
|
||||
|
||||
/**
|
||||
* A collection of roles this emoji is active for (empty if all), mapped by role ID
|
||||
* @type {Collection<Snowflake, Role>}
|
||||
|
|
|
|||
Loading…
Reference in a new issue