Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guest invites #278

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions discord/guild.go
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions discord/invite.go
Expand Up @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion discord/member.go
Expand Up @@ -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"`
Expand Down