Added server creation, server leaving/deletion and invite creation.

This commit is contained in:
hydrabolt
2015-08-12 23:23:24 +01:00
parent 7e9e7c39c0
commit dff0804854
2 changed files with 85 additions and 9 deletions

21
lib/invite.js Normal file
View File

@@ -0,0 +1,21 @@
var User = require("./user.js").User;
exports.Invite = function(json){
this.max_age = json.max_age;
this.code = json.code;
this.server = json.guild;
this.revoked = json.revoked;
this.created_at = Date.parse(json.created_at);
this.temporary = json.temporary;
this.uses = json.uses;
this.max_uses = json.uses;
this.inviter = new User(json.inviter);
this.xkcdpass = json.xkcdpass;
this.channel = json.channel;
}
exports.Invite.prototype.generateInviteURL = function(xkcd){
var code = (xkcd ? this.xkcdpass : this.code);
return "https://discord.gg/"+code;
}