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

Add Entitlements / SKUs #1552

Merged
merged 29 commits into from
Dec 8, 2024
Merged

Add Entitlements / SKUs #1552

merged 29 commits into from
Dec 8, 2024

Conversation

jhoffi
Copy link
Contributor

@jhoffi jhoffi commented Aug 2, 2024

Implementation of Entitlements and SKUs.

@jhoffi jhoffi changed the title Add Entitlements Add Entitlements / SKUs Aug 2, 2024
restapi.go Outdated Show resolved Hide resolved
@jhoffi jhoffi marked this pull request as ready for review August 14, 2024 22:40
@jhoffi jhoffi requested a review from FedorLap2006 August 16, 2024 10:13
@jhoffi
Copy link
Contributor Author

jhoffi commented Aug 29, 2024

@FedorLap2006

Copy link

@glotchimo glotchimo left a comment

Choose a reason for hiding this comment

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

Looks great, would love to see this get an owner review so it can land! Looking forward to being able to use this

@jhoffi jhoffi requested a review from glotchimo October 5, 2024 12:35
Copy link

@glotchimo glotchimo left a comment

Choose a reason for hiding this comment

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

Looks good, just curious about the use of pointers in Entitlement

// When the subscription was canceled. Only present if the subscription has been canceled.
CanceledAt *time.Time `json:"canceled_at,omitempty"`

// ISO3166-1 alpha-2 country code of the payment source used to purchase the subscription. Missing unless queried with a private OAuth scope.

Choose a reason for hiding this comment

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

+1 for including country code type

structs.go Outdated
@@ -2467,7 +2509,7 @@ type Entitlement struct {

// The ID of the user that is granted access to the entitlement's sku
// Only available for user subscriptions.
UserID string `json:"user_id,omitempty"`
UserID *string `json:"user_id,omitempty"`

Choose a reason for hiding this comment

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

Is there ever a point at which we'd expect/want a default string value here? Wondering if the introduction of pointer risk is necessary or if we can roll with default values without losing any important data (no user has no ID, no guild has no ID, no entitlement has a start time at zero, etc.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, thank you. However, I would keep all the optional timestamps as pointers, since this is also done in other structs (e.g., Channel, Member, Invite).

@ralfizzle
Copy link

Is this approved can it be merged?

@glotchimo
Copy link

Is this approved can it be merged?

AFAIK we're waiting on maintainer approval

@glotchimo
Copy link

Bumping this again - @FedorLap2006 @bwmarrin @iopred any chance this could get a stamp? Pretty important feature set here

@iopred
Copy link
Collaborator

iopred commented Dec 8, 2024

This looks great to me (but my context on discordgo is not so fresh).

I haven't merged anything in a long while, but it seems pretty reasonably reviewed by the community. Looks good to me, gl hf dd

@iopred iopred merged commit 33ffff2 into bwmarrin:master Dec 8, 2024
8 checks passed
@glotchimo
Copy link

Thanks so much!

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.

5 participants