mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
Improve emoji support
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user