Updated user class

This commit is contained in:
hydrabolt
2015-10-25 18:40:25 +00:00
parent 2de37a8fbb
commit f9679879f2

View File

@@ -18,33 +18,29 @@ var User = (function () {
// access using user.avatarURL;
User.prototype.mention = function mention() {
return "<@" + this.id + ">";
};
User.prototype.toString = function toString() {
/*
if we embed a user in a String - like so:
"Yo " + user + " what's up?"
It would generate something along the lines of:
"Yo @hydrabolt what's up?"
*/
return this.mention();
};
User.prototype.equals = function equals(object) {
return object.id === this.id;
};
User.prototype.equalsStrict = function equalsStrict(object) {
return object.id === this.id && object.avatar === this.avatar && object.username === this.username && object.discriminator === this.discriminator;
};
_createClass(User, [{
key: "mention",
value: function mention() {
return "<@" + this.id + ">";
}
}, {
key: "toString",
value: function toString() {
/*
if we embed a user in a String - like so:
"Yo " + user + " what's up?"
It would generate something along the lines of:
"Yo @hydrabolt what's up?"
*/
return this.mention();
}
}, {
key: "equals",
value: function equals(object) {
return object.id === this.id;
}
}, {
key: "equalsStrict",
value: function equalsStrict(object) {
return object.id === this.id && object.avatar === this.avatar && object.username === this.username && object.discriminator === this.discriminator;
}
}, {
key: "avatarURL",
get: function get() {
if (!this.avatar) return null;