mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 03:23:29 +01:00
Rearrange identifier
This commit is contained in:
@@ -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}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user