Rearrange identifier

This commit is contained in:
Schuyler Cebulskie
2016-12-30 21:05:34 -05:00
parent 2b25641270
commit 054d4655c1
2 changed files with 11 additions and 13 deletions

View File

@@ -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;

View File

@@ -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}`;