Deleted examples, beginning to write in EC6.

Examples and Hydrabot will soon live in a separate repo which is better
suited to learning - this is so the main package isn't bloated.
This commit is contained in:
hydrabolt
2015-08-23 16:55:23 +01:00
parent 16b007c635
commit 35b61312b9
40 changed files with 1830 additions and 2486 deletions

View File

@@ -1,6 +1,9 @@
exports.User = function( username, id, discriminator, avatar ) {
"use strict";
if ( !id ) { //there's no second argument
exports.User = function (username, id, discriminator, avatar) {
if (!id) {
//there's no second argument
var user = username;
username = user.username;
id = user.id;
@@ -12,26 +15,23 @@ exports.User = function( username, id, discriminator, avatar ) {
this.discriminator = discriminator;
this.id = id;
this.avatar = avatar;
}
};
exports.User.prototype.getAvatarURL = function() {
if ( !this.avatar )
return false;
exports.User.prototype.getAvatarURL = function () {
if (!this.avatar) return false;
return "https://discordapp.com/api/users/" + this.id + "/avatars/" + this.avatar + ".jpg";
}
};
exports.User.prototype.mention = function() {
exports.User.prototype.mention = function () {
return "<@" + this.id + ">";
}
};
exports.User.prototype.equals = function( otherUser ) {
exports.User.prototype.equals = function (otherUser) {
return otherUser.id === this.id;
};
}
exports.User.prototype.equalsStrict = function (otherUser) {
exports.User.prototype.equalsStrict = function( otherUser ) {
return ( this.username === otherUser.username && this.discriminator === otherUser.discriminator && this.id === otherUser.id && this.avatar === otherUser.avatar );
}
return this.username === otherUser.username && this.discriminator === otherUser.discriminator && this.id === otherUser.id && this.avatar === otherUser.avatar;
};