mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
Added createInvite
This commit is contained in:
26
src/Structures/Invite.js
Normal file
26
src/Structures/Invite.js
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
var Server = require("./Server.js");
|
||||
var ServerChannel = require("./ServerChannel.js");
|
||||
|
||||
class Invite{
|
||||
constructor(data, chan, client){
|
||||
this.maxAge = data.max_age;
|
||||
this.code = data.code;
|
||||
this.server = chan.server;
|
||||
this.channel = chan;
|
||||
this.revoked = data.revoked;
|
||||
this.createdAt = Date.parse(data.created_at);
|
||||
this.temporary = data.temporary;
|
||||
this.uses = data.uses;
|
||||
this.maxUses = data.uses;
|
||||
this.inviter = client.internal.users.get("id", data.inviter.id);
|
||||
this.xkcd = data.xkcdpass;
|
||||
}
|
||||
|
||||
toString(){
|
||||
return `https://discord.gg/${this.code}`;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Invite;
|
||||
Reference in New Issue
Block a user