Skip to content

Commit

Permalink
fix: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAWaifuHunter committed Feb 13, 2024
1 parent 9e0824a commit 9cf91a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions packages/darkcord/src/resources/Member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export class Member extends Base {
* This member's guild nickname
*/
nickname: string | null;
/**
* When the user joined the guild
*/
joinedAt: number | null;
declare rawData: APIGuildMember;
constructor(data: APIGuildMember, public guild: Guild) {
super(data, guild._client, data.user?.id);

Expand All @@ -86,19 +91,13 @@ export class Member extends Base {
this.premiumSince = data.premium_since
? Date.parse(data.premium_since)
: null;
this.joinedAt = data.joined_at ? Date.parse(data.joined_at) : null;
this.pending = Boolean(data.pending);
this.roles = data.roles;
this.mute = data.mute;
this.permissions = this.guild.permissionsOf(this);
}

/**
* When the user joined the guild
*/
get joinedAt(): number | null {
return this.rawData.joined_at ? Date.parse(this.rawData.joined_at) : null;
}

/**
* The current voice state of this member
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/darkcord/src/utils/Resolvable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export namespace Resolvable {
interaction.member =
guild.members.cache.get(
(interaction as Interaction<true>).member!.user?.id!,
) ?? guild.members.add(new Member(interaction.member, guild));
) ?? guild.members.add(new Member(interaction.rawData.member!, guild));
}
}

Expand Down

0 comments on commit 9cf91a4

Please sign in to comment.