feat(Invite): add targetUser(Type) (#3262)

* add Invite#targetUser(Type)

* incase discord decides to add 0
This commit is contained in:
izexi
2019-08-17 19:31:04 +01:00
committed by SpaceEEC
parent 8ae7a30d0b
commit d62db232e7
2 changed files with 22 additions and 0 deletions

View File

@@ -70,6 +70,24 @@ class Invite extends Base {
*/
this.inviter = data.inviter ? this.client.users.add(data.inviter) : null;
/**
* The target user for this invite
* @type {?User}
*/
this.targetUser = data.target_user ? this.client.users.add(data.target_user) : null;
/**
* The type of the target user:
* * 1: STREAM
* @typedef {number} TargetUser
*/
/**
* The target user type
* @type {?TargetUser}
*/
this.targetUserType = typeof data.target_user_type === 'number' ? data.target_user_type : null;
/**
* The channel the invite is for
* @type {Channel}

4
typings/index.d.ts vendored
View File

@@ -928,6 +928,8 @@ declare module 'discord.js' {
public maxUses: number | null;
public memberCount: number;
public presenceCount: number;
public targetUser: User | null;
public targetUserType: TargetUser | null;
public temporary: boolean | null;
public readonly url: string;
public uses: number | null;
@@ -2524,6 +2526,8 @@ declare module 'discord.js' {
type StringResolvable = string | string[] | any;
type TargetUser = number;
type UserResolvable = User | Snowflake | Message | GuildMember;
type VoiceStatus = number;