From 38f436e3ff4bf5afa57ee1513e595c79a65bf108 Mon Sep 17 00:00:00 2001 From: mlnrDev Date: Thu, 22 Jun 2023 20:09:50 +0200 Subject: [PATCH] Add guest invites --- discord/guild.go | 1 + discord/invite.go | 8 ++++++++ discord/member.go | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/discord/guild.go b/discord/guild.go index 5ca15bc52..340cd8765 100644 --- a/discord/guild.go +++ b/discord/guild.go @@ -104,6 +104,7 @@ const ( GuildFeatureDeveloperSupportServer GuildFeature = "DEVELOPER_SUPPORT_SERVER" GuildFeatureDiscoverable GuildFeature = "DISCOVERABLE" GuildFeatureFeaturable GuildFeature = "FEATURABLE" + GuildFeatureGuestsEnabled GuildFeature = "GUESTS_ENABLED" GuildFeatureInvitesDisabled GuildFeature = "INVITES_DISABLED" GuildFeatureInviteSplash GuildFeature = "INVITE_SPLASH" GuildFeatureMemberVerificationGateEnabled GuildFeature = "MEMBER_VERIFICATION_GATE_ENABLED" diff --git a/discord/invite.go b/discord/invite.go index b8aaae5bd..d4b4525a9 100644 --- a/discord/invite.go +++ b/discord/invite.go @@ -28,12 +28,20 @@ type Invite struct { ApproximateMemberCount int `json:"approximate_member_count"` ExpiresAt *time.Time `json:"expires_at"` GuildScheduledEvent *GuildScheduledEvent `json:"guild_scheduled_event"` + Flags InviteFlags `json:"flags"` } func (i Invite) URL() string { return InviteURL(i.Code) } +type InviteFlags int + +const ( + InviteFlagGuest InviteFlags = 1 << iota + InviteFlagsNone InviteFlags = 0 +) + type ExtendedInvite struct { Invite Uses int `json:"uses"` diff --git a/discord/member.go b/discord/member.go index 126661049..46197578a 100644 --- a/discord/member.go +++ b/discord/member.go @@ -17,7 +17,7 @@ type Member struct { Nick *string `json:"nick"` Avatar *string `json:"avatar"` RoleIDs []snowflake.ID `json:"roles,omitempty"` - JoinedAt time.Time `json:"joined_at"` + JoinedAt *time.Time `json:"joined_at"` PremiumSince *time.Time `json:"premium_since,omitempty"` Deaf bool `json:"deaf,omitempty"` Mute bool `json:"mute,omitempty"`