aboutsummaryrefslogtreecommitdiff
path: root/node_modules/discord.js/src/structures/Emoji.js
diff options
context:
space:
mode:
authorAlee14 <Alee14498@gmail.com>2017-07-28 16:20:27 -0400
committerAlee14 <Alee14498@gmail.com>2017-07-28 16:20:27 -0400
commitd35e0862e6b60fe3c4f823371627359f3ce3e68b (patch)
treed98b788eb1abf0a8814207b993b4e22efe711deb /node_modules/discord.js/src/structures/Emoji.js
parent20993df62e7e38ed43428aafa5981afc3543bdea (diff)
downloadAleeBot-d35e0862e6b60fe3c4f823371627359f3ce3e68b.tar.gz
AleeBot-d35e0862e6b60fe3c4f823371627359f3ce3e68b.tar.bz2
AleeBot-d35e0862e6b60fe3c4f823371627359f3ce3e68b.zip
Removing node modules (go get them yourself :P)
Diffstat (limited to 'node_modules/discord.js/src/structures/Emoji.js')
-rw-r--r--node_modules/discord.js/src/structures/Emoji.js140
1 files changed, 0 insertions, 140 deletions
diff --git a/node_modules/discord.js/src/structures/Emoji.js b/node_modules/discord.js/src/structures/Emoji.js
deleted file mode 100644
index d8a62e1..0000000
--- a/node_modules/discord.js/src/structures/Emoji.js
+++ /dev/null
@@ -1,140 +0,0 @@
-const Constants = require('../util/Constants');
-const Collection = require('../util/Collection');
-
-/**
- * Represents a custom emoji
- */
-class Emoji {
- constructor(guild, data) {
- /**
- * The Client that instantiated this object
- * @name Emoji#client
- * @type {Client}
- * @readonly
- */
- Object.defineProperty(this, 'client', { value: guild.client });
-
- /**
- * The guild this emoji is part of
- * @type {Guild}
- */
- this.guild = guild;
-
- this.setup(data);
- }
-
- setup(data) {
- /**
- * The ID of the emoji
- * @type {string}
- */
- this.id = data.id;
-
- /**
- * The name of the emoji
- * @type {string}
- */
- this.name = data.name;
-
- /**
- * Whether or not this emoji requires colons surrounding it
- * @type {boolean}
- */
- this.requiresColons = data.require_colons;
-
- /**
- * Whether this emoji is managed by an external service
- * @type {boolean}
- */
- this.managed = data.managed;
-
- this._roles = data.roles;
- }
-
- /**
- * The timestamp the emoji was created at
- * @type {number}
- * @readonly
- */
- get createdTimestamp() {
- return (this.id / 4194304) + 1420070400000;
- }
-
- /**
- * The time the emoji was created
- * @type {Date}
- * @readonly
- */
- get createdAt() {
- return new Date(this.createdTimestamp);
- }
-
- /**
- * A collection of roles this emoji is active for (empty if all), mapped by role ID.
- * @type {Collection<string, Role>}
- * @readonly
- */
- get roles() {
- const roles = new Collection();
- for (const role of this._roles) {
- if (this.guild.roles.has(role)) roles.set(role, this.guild.roles.get(role));
- }
- return roles;
- }
-
- /**
- * The URL to the emoji file
- * @type {string}
- * @readonly
- */
- get url() {
- return Constants.Endpoints.emoji(this.id);
- }
-
- /**
- * When concatenated with a string, this automatically returns the emoji mention rather than the object.
- * @returns {string}
- * @example
- * // send an emoji:
- * const emoji = guild.emojis.first();
- * msg.reply(`Hello! ${emoji}`);
- */
- toString() {
- return this.requiresColons ? `<:${this.name}:${this.id}>` : this.name;
- }
-
- /**
- * Whether this emoji is the same as another one
- * @param {Emoji|Object} other the emoji to compare it to
- * @returns {boolean} whether the emoji is equal to the given emoji or not
- */
- equals(other) {
- if (other instanceof Emoji) {
- return (
- other.id === this.id &&
- other.name === this.name &&
- other.managed === this.managed &&
- other.requiresColons === this.requiresColons
- );
- } else {
- return (
- other.id === this.id &&
- other.name === 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;