-
Notifications
You must be signed in to change notification settings - Fork 821
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
Add Entitlements / SKUs #1552
Conversation
There was a problem hiding this 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
There was a problem hiding this 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. |
There was a problem hiding this comment.
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"` |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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).
Is this approved can it be merged? |
AFAIK we're waiting on maintainer approval |
Bumping this again - @FedorLap2006 @bwmarrin @iopred any chance this could get a stamp? Pretty important feature set here |
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 |
Thanks so much! |
Implementation of Entitlements and SKUs.