feat(user): add UserPremiumType type (#1467)

* feat(user): Add UserPremiumType type

* chore(UserPremiumType): fix type name in comment

* style: periods

Add periods at the end of the documentation comments.

* chore(UserPremiumType): reword documentation comment

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
This commit is contained in:
LightningDev1 2023-12-04 11:34:26 +01:00 committed by Fedor Lapshin
parent 1f0b57f110
commit e8b8ad326b
No known key found for this signature in database
GPG key ID: 492D745FB49D2DAB

14
user.go
View file

@ -26,6 +26,18 @@ const (
UserFlagDiscordCertifiedModerator UserFlags = 1 << 18
)
// UserPremiumType is the type of premium (nitro) subscription a user has (see UserPremiumType* consts).
// https://discord.com/developers/docs/resources/user#user-object-premium-types
type UserPremiumType int
// Valid UserPremiumType values.
const (
UserPremiumTypeNone UserPremiumType = 0
UserPremiumTypeNitroClassic UserPremiumType = 1
UserPremiumTypeNitro UserPremiumType = 2
UserPremiumTypeNitroBasic UserPremiumType = 3
)
// A User stores all data for an individual Discord user.
type User struct {
// The ID of the user.
@ -78,7 +90,7 @@ type User struct {
// The type of Nitro subscription on a user's account.
// Only available when the request is authorized via a Bearer token.
PremiumType int `json:"premium_type"`
PremiumType UserPremiumType `json:"premium_type"`
// Whether the user is an Official Discord System user (part of the urgent message system).
System bool `json:"system"`