-
Notifications
You must be signed in to change notification settings - Fork 828
/
Copy pathentitlement.go
54 lines (42 loc) · 1.64 KB
/
entitlement.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package discordgo
// EntitlementType is the type of entitlement (see EntitlementType* consts)
// https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
type EntitlementType int
// Valid EntitlementType values
const (
EntitlementTypePurchase = 1
EntitlementTypePremiumSubscription = 2
EntitlementTypeDeveloperGift = 3
EntitlementTypeTestModePurchase = 4
EntitlementTypeFreePurchase = 5
EntitlementTypeUserGift = 6
EntitlementTypeApplicationSubscription = 8
EntitlementTypePremiumPurchase = 7
)
// Entitlement represents that a user or guild has access to a premium offering
// in your application.
type Entitlement struct {
// The ID of the entitlement
ID string `json:"id"`
// The ID of the SKU
SkuID string `json:"sku_id"`
// The ID of the parent application
ApplicationID string `json:"application_id"`
// The ID of the user that is granted access to the entitlement's sku
UserID string `json:"user_id"`
// The type of entitlement
Type EntitlementType `json:"type"`
// The entitlement was deleted
Deleted bool `json:"deleted"`
// The start date at which the entitlement is valid.
// Not present when using test entitlements.
StartsAt string `json:"starts_at"`
// The date at which the entitlement is no longer valid.
// Not present when using test entitlements.
EndsAt string `json:"ends_at"`
// The ID of the guild that is granted access to the entitlement's sku.
GuildID string `json:"guild_id"`
// Whether or not the entitlement has been consumed.
// Only available for consumable items.
Consumed bool `json:"consumed"`
}