Skip to content

Commit

Permalink
feat(Invite): add targetUser(Type) (#3262)
Browse files Browse the repository at this point in the history
* add Invite#targetUser(Type)

* incase discord decides to add 0
  • Loading branch information
izexi authored and SpaceEEC committed Aug 17, 2019
1 parent 8ae7a30 commit d62db23
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/structures/Invite.js
Expand Up @@ -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}
Expand Down
4 changes: 4 additions & 0 deletions typings/index.d.ts
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d62db23

Please sign in to comment.