forked from andersfylling/disgord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
invite.go
53 lines (40 loc) · 1.51 KB
/
invite.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
package resource
// Invite Represents a code that when used, adds a user to a guild.
// https://discordapp.com/developers/docs/resources/invite#invite-object
// Reviewed: 2018-06-10
type Invite struct {
// Code the invite code (unique Snowflake)
Code string `json:"code"`
// Guild the guild this invite is for
Guild *PartialGuild `json:"guild"`
// Channel the channel this invite is for
Channel *PartialChannel `json:"channel"`
// ApproximatePresenceCount approximate count of online members
ApproximatePresenceCount int `json:"approximate_presence_count,omitempty"`
// ApproximatePresenceCount approximate count of total members
ApproximateMemberCount int `json:"approximate_member_count,omitempty"`
}
// InviteMetadata Object
// https://discordapp.com/developers/docs/resources/invite#invite-metadata-object
// Reviewed: 2018-06-10
type InviteMetadata struct {
// Inviter user who created the invite
Inviter *User `json:"inviter"`
// Uses number of times this invite has been used
Uses int `json:"uses"`
// MaxUses max number of times this invite can be used
MaxUses int `json:"max_uses"`
// MaxAge duration (in seconds) after which the invite expires
MaxAge int `json:"max_age"`
// Temporary whether this invite only grants temporary membership
Temporary bool `json:"temporary"`
// CreatedAt when this invite was created
CreatedAt Timestamp `json:"created_at"`
// Revoked whether this invite is revoked
Revoked bool `json:"revoked"`
}
// PartialInvite
// {
// "code": "abc"
// }
type PartialInvite = Invite