Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more stuff to invites! #1496

Merged
merged 1 commit into from
May 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 18 additions & 27 deletions src/structures/Invite.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,6 @@ const PartialGuild = require('./PartialGuild');
const PartialGuildChannel = require('./PartialGuildChannel');
const Constants = require('../util/Constants');

/*
{ max_age: 86400,
code: 'CG9A5',
guild:
{ splash: null,
id: '123123123',
icon: '123123123',
name: 'name' },
created_at: '2016-08-28T19:07:04.763368+00:00',
temporary: false,
uses: 0,
max_uses: 0,
inviter:
{ username: '123',
discriminator: '4204',
bot: true,
id: '123123123',
avatar: '123123123' },
channel: { type: 0, id: '123123', name: 'heavy-testing' } }
*/

/**
* Represents an invitation to a guild channel.
* <warn>The only guaranteed properties are `code`, `guild` and `channel`. Other properties can be missing.</warn>
Expand Down Expand Up @@ -60,6 +39,24 @@ class Invite {
*/
this.presenceCount = data.approximate_presence_count;

/**
* The approximate total number of members of the guild this invite is for
* @type {number}
*/
this.memberCount = data.approximate_member_count;

/**
* The number of text channels the guild this invite goes to has
* @type {number}
*/
this.textChannelCount = data.guild.text_channel_count;

/**
* The number of voice channels the guild this invite goes to has
* @type {number}
*/
this.voiceChannelCount = data.guild.voice_channel_count;

/**
* Whether or not this invite is temporary
* @type {boolean}
Expand All @@ -72,12 +69,6 @@ class Invite {
*/
this.maxAge = data.max_age;

/**
* The approximate total number of members of the guild this invite is for
* @type {number}
*/
this.memberCount = data.approximate_member_count;

/**
* How many times this invite has been used
* @type {number}
Expand Down