mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 20:42:27 +00:00
Rearrange identifier
This commit is contained in:
parent
2b25641270
commit
054d4655c1
2 changed files with 11 additions and 13 deletions
|
|
@ -91,6 +91,16 @@ class Emoji {
|
|||
return Constants.Endpoints.emoji(this.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* The identifier of this emoji, used for message reactions
|
||||
* @type {string}
|
||||
* @readonly
|
||||
*/
|
||||
get identifier() {
|
||||
if (this.id) return `${this.name}:${this.id}`;
|
||||
return encodeURIComponent(this.name);
|
||||
}
|
||||
|
||||
/**
|
||||
* When concatenated with a string, this automatically returns the emoji mention rather than the object.
|
||||
* @returns {string}
|
||||
|
|
@ -123,18 +133,6 @@ class Emoji {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The identifier of this emoji, used for message reactions
|
||||
* @readonly
|
||||
* @type {string}
|
||||
*/
|
||||
get identifier() {
|
||||
if (this.id) {
|
||||
return `${this.name}:${this.id}`;
|
||||
}
|
||||
return encodeURIComponent(this.name);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Emoji;
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ class ReactionEmoji {
|
|||
|
||||
/**
|
||||
* The identifier of this emoji, used for message reactions
|
||||
* @readonly
|
||||
* @type {string}
|
||||
* @readonly
|
||||
*/
|
||||
get identifier() {
|
||||
if (this.id) return `${this.name}:${this.id}`;
|
||||
|
|
|
|||
Loading…
Reference in a new issue