-
Notifications
You must be signed in to change notification settings - Fork 35
/
entitlement.go
46 lines (38 loc) · 1.19 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
package discord
import (
"time"
"github.com/disgoorg/snowflake/v2"
)
type Entitlement struct {
ID snowflake.ID `json:"id"`
SkuID snowflake.ID `json:"sku_id"`
ApplicationID snowflake.ID `json:"application_id"`
UserID *snowflake.ID `json:"user_id"`
Type EntitlementType `json:"type"`
Deleted bool `json:"deleted"`
StartsAt *time.Time `json:"starts_at"`
EndsAt *time.Time `json:"ends_at"`
GuildID *snowflake.ID `json:"guild_id"`
Consumed *bool `json:"consumed"`
}
type EntitlementType int
const (
EntitlementTypePurchase EntitlementType = iota + 1
EntitlementTypePremiumSubscription
EntitlementTypeDeveloperGift
EntitlementTypeTestModePurchase
EntitlementTypeFreePurchase
EntitlementTypeUserGift
EntitlementTypePremiumPurchase
EntitlementTypeApplicationSubscription
)
type TestEntitlementCreate struct {
SkuID snowflake.ID `json:"sku_id"`
OwnerID snowflake.ID `json:"owner_id"`
OwnerType EntitlementOwnerType `json:"owner_type"`
}
type EntitlementOwnerType int
const (
EntitlementOwnerTypeGuild EntitlementOwnerType = iota + 1
EntitlementOwnerTypeUser
)