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

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

Merged
merged 2 commits into from Aug 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -638,6 +638,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 @@ -2196,6 +2198,8 @@ declare module 'discord.js' {

type StringResolvable = string | string[] | any;

type TargetUser = number;

type UserResolvable = User | Snowflake | Message | GuildMember;

type VoiceStatus = number;
Expand Down