From 05dbf0e2b4418def511207daf321db436ea065c2 Mon Sep 17 00:00:00 2001 From: ayn2op <119342035+ayn2op@users.noreply.github.com> Date: Fri, 27 Jan 2023 02:39:19 +0530 Subject: [PATCH] discord: Add Flags field to Member struct (#369) Reference: https://github.com/discord/discord-api-docs/pull/5874 --- discord/guild.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/discord/guild.go b/discord/guild.go index cba47aa..5d63f5c 100644 --- a/discord/guild.go +++ b/discord/guild.go @@ -389,6 +389,9 @@ type Member struct { // Mute specifies whether the user is muted in voice channels. Mute bool `json:"mute"` + // Flags is the member's flags represented as a bit set, defaults to 0. + Flags MemberFlags `json:"flags"` + // IsPending specifies whether the user has not yet passed the guild's Membership Screening requirements IsPending bool `json:"pending"` } @@ -416,6 +419,15 @@ func (m Member) AvatarURLWithType(t ImageType, guildID GuildID) string { return "https://cdn.discordapp.com/guilds/" + guildID.String() + "/users/" + m.User.ID.String() + "/avatars/" + t.format(m.Avatar) } +type MemberFlags uint8 + +const ( + MemberFlagsDidRejoin = 1 << iota + MemberFlagsCompletedOnboarding + MemberFlagsBypassesVerification + MemberFlagsStartedOnboarding +) + // https://discord.com/developers/docs/resources/guild#ban-object type Ban struct { // Reason is the reason for the ban.