mirror of
https://github.com/danbulant/discord.js
synced 2026-06-07 00:32:03 +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);
|
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.
|
* When concatenated with a string, this automatically returns the emoji mention rather than the object.
|
||||||
* @returns {string}
|
* @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;
|
module.exports = Emoji;
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ class ReactionEmoji {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The identifier of this emoji, used for message reactions
|
* The identifier of this emoji, used for message reactions
|
||||||
* @readonly
|
|
||||||
* @type {string}
|
* @type {string}
|
||||||
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get identifier() {
|
get identifier() {
|
||||||
if (this.id) return `${this.name}:${this.id}`;
|
if (this.id) return `${this.name}:${this.id}`;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue