Add functionality for GuildEmoji events

This commit is contained in:
Amish Shah
2016-12-26 19:21:00 +00:00
parent 2410fdf8d2
commit cd657be8be
10 changed files with 80 additions and 40 deletions

View File

@@ -103,6 +103,27 @@ class Emoji {
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