diff options
| author | 8cy <[email protected]> | 2020-04-03 02:48:28 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-03 02:48:28 -0700 |
| commit | f9159ea2d994e14180fb02ab562f0119513e67cf (patch) | |
| tree | 09d14cdf05456567156738b681379d4bccd64e5c /node_modules/discord.js/src/structures/ReactionEmoji.js | |
| parent | 2020/04/03, 02:42, V1.2.1 (diff) | |
| download | s5nical-f9159ea2d994e14180fb02ab562f0119513e67cf.tar.xz s5nical-f9159ea2d994e14180fb02ab562f0119513e67cf.zip | |
2020/04/03, 02:47, V1.2.2
Diffstat (limited to 'node_modules/discord.js/src/structures/ReactionEmoji.js')
| -rw-r--r-- | node_modules/discord.js/src/structures/ReactionEmoji.js | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/node_modules/discord.js/src/structures/ReactionEmoji.js b/node_modules/discord.js/src/structures/ReactionEmoji.js deleted file mode 100644 index 9f7597e..0000000 --- a/node_modules/discord.js/src/structures/ReactionEmoji.js +++ /dev/null @@ -1,98 +0,0 @@ -const Constants = require('../util/Constants'); -const Snowflake = require('../util/Snowflake'); - -/** - * Represents a limited emoji set used for both custom and unicode emojis. Custom emojis - * will use this class opposed to the Emoji class when the client doesn't know enough - * information about them. - */ -class ReactionEmoji { - constructor(reaction, emoji) { - /** - * The client that instantiated this object - * @name ReactionEmoji#client - * @type {Client} - * @readonly - */ - Object.defineProperty(this, 'client', { value: reaction.message.client }); - - /** - * The message reaction this emoji refers to - * @type {MessageReaction} - */ - this.reaction = reaction; - - /** - * The name of this reaction emoji - * @type {string} - */ - this.name = emoji.name; - - /** - * The ID of this reaction emoji - * @type {?Snowflake} - */ - this.id = emoji.id; - - /** - * Whether this reaction emoji is animated - * @type {boolean} - */ - this.animated = emoji.animated || false; - } - - /** - * The timestamp the reaction emoji was created at, or null if unicode - * @type {?number} - * @readonly - */ - get createdTimestamp() { - if (!this.id) return null; - return Snowflake.deconstruct(this.id).timestamp; - } - - /** - * The time the reaction emoji was created, or null if unicode - * @type {?Date} - * @readonly - */ - get createdAt() { - if (!this.id) return null; - return new Date(this.createdTimestamp); - } - - /** - * The URL to the reaction emoji file, or null if unicode - * @type {string} - * @readonly - */ - get url() { - if (!this.id) return null; - return Constants.Endpoints.CDN(this.client.options.http.cdn).Emoji(this.id, this.animated ? 'gif' : 'png'); - } - - /** - * 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); - } - - /** - * Creates the text required to form a graphical emoji on Discord. - * @example - * // Send the emoji used in a reaction to the channel the reaction is part of - * reaction.message.channel.send(`The emoji used is ${reaction.emoji}`); - * @returns {string} - */ - toString() { - if (!this.id) return this.name; - - return `<${this.animated ? 'a' : ''}:${this.name}:${this.id}>`; - } -} - -module.exports = ReactionEmoji; |