Skip to content

Commit

Permalink
refactor(TeamMember): make id a getter
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceEEC authored and samsamson33 committed Feb 27, 2020
1 parent 20aa1a7 commit bd40600
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/structures/TeamMember.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ class TeamMember extends Base {
* @type {User}
*/
this.user = this.client.users.add(data.user);
}

/**
* The ID of the Team Member
* @type {Snowflake}
*/
this.id = this.user.id;
/**
* The ID of the Team Member
* @type {Snowflake}
* @readonly
*/
get id() {
return this.user.id;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ declare module 'discord.js' {
export class TeamMember extends Base {
constructor(client: Client, team: Team, data: object);
public team: Team;
public id: Snowflake;
public readonly id: Snowflake;
public permissions: string[];
public membershipState: MembershipStates;
public user: User;
Expand Down

0 comments on commit bd40600

Please sign in to comment.