Improve emoji support

This commit is contained in:
Amish Shah
2016-10-27 16:12:02 +01:00
parent 81059885a2
commit d129457624
4 changed files with 99 additions and 8 deletions

View File

@@ -101,6 +101,18 @@ class Emoji {
toString() {
return this.requiresColons ? `<:${this.name}:${this.id}>` : this.name;
}
/**
* 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;