mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
refactor: new node features (#5132)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -40,37 +40,37 @@ class Invite extends Base {
|
||||
* The approximate number of online members of the guild this invite is for
|
||||
* @type {?number}
|
||||
*/
|
||||
this.presenceCount = 'approximate_presence_count' in data ? data.approximate_presence_count : null;
|
||||
this.presenceCount = data.approximate_presence_count ?? null;
|
||||
|
||||
/**
|
||||
* The approximate total number of members of the guild this invite is for
|
||||
* @type {?number}
|
||||
*/
|
||||
this.memberCount = 'approximate_member_count' in data ? data.approximate_member_count : null;
|
||||
this.memberCount = data.approximate_member_count ?? null;
|
||||
|
||||
/**
|
||||
* Whether or not this invite is temporary
|
||||
* @type {?boolean}
|
||||
*/
|
||||
this.temporary = 'temporary' in data ? data.temporary : null;
|
||||
this.temporary = data.temporary ?? null;
|
||||
|
||||
/**
|
||||
* The maximum age of the invite, in seconds, 0 if never expires
|
||||
* @type {?number}
|
||||
*/
|
||||
this.maxAge = 'max_age' in data ? data.max_age : null;
|
||||
this.maxAge = data.max_age ?? null;
|
||||
|
||||
/**
|
||||
* How many times this invite has been used
|
||||
* @type {?number}
|
||||
*/
|
||||
this.uses = 'uses' in data ? data.uses : null;
|
||||
this.uses = data.uses ?? null;
|
||||
|
||||
/**
|
||||
* The maximum uses of this invite
|
||||
* @type {?number}
|
||||
*/
|
||||
this.maxUses = 'max_uses' in data ? data.max_uses : null;
|
||||
this.maxUses = data.max_uses ?? null;
|
||||
|
||||
/**
|
||||
* The user who created this invite
|
||||
@@ -103,7 +103,7 @@ class Invite extends Base {
|
||||
* The target type
|
||||
* @type {?TargetType}
|
||||
*/
|
||||
this.targetType = typeof data.target_type === 'number' ? data.target_type : null;
|
||||
this.targetType = data.target_type ?? null;
|
||||
|
||||
/**
|
||||
* The channel the invite is for
|
||||
|
||||
Reference in New Issue
Block a user