Skip to content

Commit

Permalink
Add Type to Invite
Browse files Browse the repository at this point in the history
  • Loading branch information
mlnrDev committed Dec 11, 2023
1 parent 2cd6c49 commit 932f452
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions discord/invite.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const (

// Invite is a partial invite struct
type Invite struct {
Type InviteType `json:"type"`
Code string `json:"code"`
Guild *InviteGuild `json:"guild"`
Channel *InviteChannel `json:"channel"`
Expand All @@ -35,6 +36,14 @@ func (i Invite) URL() string {
return InviteURL(i.Code)
}

type InviteType int

const (
InviteTypeGuild InviteType = iota
InviteTypeGroupDM
InviteTypeFriend
)

type ExtendedInvite struct {
Invite
Uses int `json:"uses"`
Expand Down

0 comments on commit 932f452

Please sign in to comment.