1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-17 20:32:48 +00:00
arikawa/discord/invite.go

37 lines
1.1 KiB
Go
Raw Normal View History

package discord
type Invite struct {
Code string `json:"code"`
Channel Channel `json:"channel"` // partial
Guild *Guild `json:"guild,omitempty"` // partial
ApproxMembers uint `json:"approximate_members_count,omitempty"`
Target *User `json:"target_user,omitempty"` // partial
TargetType InviteUserType `json:"target_user_type,omitempty"`
// Only available if Target is
ApproxPresences uint `json:"approximate_presence_count,omitempty"`
}
type InviteUserType uint8
const (
InviteNormalUser InviteUserType = iota
InviteUserStream
)
2020-05-08 00:09:45 +00:00
// Extra information about an invite, will extend the invite object.
type InviteMetadata struct {
// Number of times this invite has been used
Uses int `json:"uses"`
// Max number of times this invite can be used
MaxUses int `json:"max_uses"`
// Duration (in seconds) after which the invite expires
MaxAge Seconds `json:"max_age"`
// Whether this invite only grants temporary membership
Temporary bool `json:"temporary"`
// When this invite was created
CreatedAt Timestamp `json:"created_at"`
}