Skip to content

Commit 749a1ff

Browse files
committed
fix invite structure
1 parent ef45871 commit 749a1ff

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

gateway.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
package objects
22

3-
type InviteTargetType int
4-
5-
const (
6-
InviteTargetType_STREAM InviteTargetType = iota + 1
7-
InviteTargetType_EMBEDDED_APPLICATION
8-
)
9-
103
type (
114
Ready struct {
125
Version int `json:"v"`

invite.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package objects
22

33
// https://discord.com/developers/docs/resources/invite#invite-object-invite-structure
4-
type InviteTargetUser uint
4+
type InviteTargetType int
55

66
const (
7-
TargetUserStream InviteTargetUser = 1
7+
InviteTargetType_STREAM InviteTargetType = iota + 1
8+
InviteTargetType_EMBEDDED_APPLICATION
89
)
910

1011
// Invite represents a code that when used, adds a user to a guild or group DM channel.
@@ -25,9 +26,11 @@ type Invite struct {
2526
// the target user for this invite
2627
TargetUser *User `json:"target_user,omitempty"`
2728

28-
// the type of user target for this invite
29-
// https://discord.com/developers/docs/resources/invite#invite-object-example-invite-object
30-
TargetUserType InviteTargetUser `json:"target_user_type,omitempty"`
29+
// The target type for this invite
30+
TargetType InviteTargetType `json:"target_type,omitempty"`
31+
32+
// The application the invite is targeting
33+
TargetApplication *Application `json:"target_application,omitempty"`
3134

3235
// approximate count of online members (only present when target_user is set)
3336
ApproximatePresenceCount int `json:"approximate_presence_count,omitempty"`

0 commit comments

Comments
 (0)