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

Implementing Subscriptions #1591

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions eventhandlers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions events.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,3 +461,15 @@ type EntitlementUpdate struct {
type EntitlementDelete struct {
*Entitlement
}

// SubscriptionCreate is the data for an SubscriptionCreate event.
// https://discord.com/developers/docs/monetization/implementing-app-subscriptions#using-subscription-events-for-the-subscription-lifecycle
type SubscriptionCreate struct {
*Subscription
}

// SubscriptionUpdate is the data for an SubscriptionUpdate event.
// https://discord.com/developers/docs/monetization/implementing-app-subscriptions#using-subscription-events-for-the-subscription-lifecycle
type SubscriptionUpdate struct {
*Subscription
}
3 changes: 3 additions & 0 deletions structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2457,6 +2457,9 @@ type Subscription struct {
// List of entitlements granted for this subscription
EntitlementIDs []string `json:"entitlement_ids"`

// List of SKUs that this user will be subscribed to at renewal
RenewalSKUIDs []string `json:"renewal_sku_ids,omitempty"`

// Start of the current subscription period
CurrentPeriodStart time.Time `json:"current_period_start"`

Expand Down