Skip to content

Commit b642511

Browse files
sebm253mlnrDev
andauthored
Add guest invites (#278)
* Add guest invites * rename const --------- Co-authored-by: mlnrDev <[email protected]>
1 parent 7c62b71 commit b642511

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

discord/guild.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const (
110110
GuildFeatureDiscoverable GuildFeature = "DISCOVERABLE"
111111
GuildFeatureEnhancedRoleColors GuildFeature = "ENHANCED_ROLE_COLORS"
112112
GuildFeatureFeaturable GuildFeature = "FEATURABLE"
113+
GuildFeatureGuestsEnabled GuildFeature = "GUESTS_ENABLED"
113114
GuildFeatureInvitesDisabled GuildFeature = "INVITES_DISABLED"
114115
GuildFeatureInviteSplash GuildFeature = "INVITE_SPLASH"
115116
GuildFeatureMemberVerificationGateEnabled GuildFeature = "MEMBER_VERIFICATION_GATE_ENABLED"

discord/invite.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ type Invite struct {
2929
ApproximateMemberCount int `json:"approximate_member_count"`
3030
ExpiresAt *time.Time `json:"expires_at"`
3131
GuildScheduledEvent *GuildScheduledEvent `json:"guild_scheduled_event"`
32+
Flags InviteFlags `json:"flags"`
3233
}
3334

3435
func (i Invite) URL() string {
@@ -43,6 +44,13 @@ const (
4344
InviteTypeFriend
4445
)
4546

47+
type InviteFlags int
48+
49+
const (
50+
InviteFlagIsGuestInvite InviteFlags = 1 << iota
51+
InviteFlagsNone InviteFlags = 0
52+
)
53+
4654
type ExtendedInvite struct {
4755
Invite
4856
Uses int `json:"uses"`

discord/member.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type Member struct {
1818
Avatar *string `json:"avatar"`
1919
Banner *string `json:"banner"`
2020
RoleIDs []snowflake.ID `json:"roles,omitempty"`
21-
JoinedAt time.Time `json:"joined_at"`
21+
JoinedAt *time.Time `json:"joined_at"`
2222
PremiumSince *time.Time `json:"premium_since,omitempty"`
2323
Deaf bool `json:"deaf,omitempty"`
2424
Mute bool `json:"mute,omitempty"`

0 commit comments

Comments
 (0)