Skip to content

Commit

Permalink
Implementing Subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
iaping committed Jan 7, 2025
1 parent 33ffff2 commit 1a29d3a
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
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

0 comments on commit 1a29d3a

Please sign in to comment.