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

fix(GuildMember): correctly check for premium_since #5312

Merged
merged 2 commits into from Apr 14, 2021

Conversation

NotSugden
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:
This PR fixes a bug introduced by #4636, GuildMember#premiumSinceTimestamp was being set to 0 every time rather than null

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@SpaceEEC
Copy link
Member

How does Discord propagate this property changing to null? (i.e. when the member stops boosting)

@iCrawl iCrawl requested a review from vladfrangu April 3, 2021 13:14
@NotSugden
Copy link
Contributor Author

How does Discord propagate this property changing to null? (i.e. when the member stops boosting)

not sure, I would assume though that premium_since would be null so i've updated that to take that into account, no way of really testing this though

Copy link
Member

@SpaceEEC SpaceEEC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's hope for the best then.

Comment on lines +88 to +90
if ('premium_since' in data) {
this.premiumSinceTimestamp = data.premium_since === null ? null : new Date(data.premium_since).getTime();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ('premium_since' in data) {
this.premiumSinceTimestamp = data.premium_since === null ? null : new Date(data.premium_since).getTime();
}
if ('premium_since' in data) this.premiumSinceTimestamp = data.premium_since && new Date(data.premium_since).getTime();

@kyranet kyranet requested a review from iCrawl April 14, 2021 19:52
@iCrawl iCrawl merged commit aff3625 into discordjs:master Apr 14, 2021
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
@NotSugden NotSugden deleted the patch-4 branch July 28, 2021 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants