Skip to content

Commit

Permalink
feat(member): add flags (#1499)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Fedor Lapshin <[email protected]>
  • Loading branch information
Earlopain and FedorLap2006 authored Feb 29, 2024
1 parent 8968e58 commit 384ff4e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,22 @@ type Assets struct {
SmallText string `json:"small_text,omitempty"`
}

// MemberFlags represent flags of a guild member.
// https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags
type MemberFlags int

// Block containing known MemberFlags values.
const (
// MemberFlagDidRejoin indicates whether the Member has left and rejoined the guild.
MemberFlagDidRejoin MemberFlags = 1 << 0
// MemberFlagCompletedOnboarding indicates whether the Member has completed onboarding.
MemberFlagCompletedOnboarding MemberFlags = 1 << 1
// MemberFlagBypassesVerification indicates whether the Member is exempt from guild verification requirements.
MemberFlagBypassesVerification MemberFlags = 1 << 2
// MemberFlagStartedOnboarding indicates whether the Member has started onboarding.
MemberFlagStartedOnboarding MemberFlags = 1 << 3
)

// A Member stores user information for Guild members. A guild
// member represents a certain user's presence in a guild.
type Member struct {
Expand Down Expand Up @@ -1506,6 +1522,10 @@ type Member struct {
// When the user used their Nitro boost on the server
PremiumSince *time.Time `json:"premium_since"`

// The flags of this member. This is a combination of bit masks; the presence of a certain
// flag can be checked by performing a bitwise AND between this int and the flag.
Flags MemberFlags `json:"flags"`

// Is true while the member hasn't accepted the membership screen.
Pending bool `json:"pending"`

Expand Down

0 comments on commit 384ff4e

Please sign in to comment.